Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to paste multiple environment variables in IntelliJ

Is there a way to add multiple environment variables in IntelliJ? When one sends me a list of variables I can add them one by one by clicking + in this window

enter image description here

But it's quite annoying to do for 10 or 20 variables every time. I can copy all variables from Environment variables field but we cannot paste there. Is there any way to do it?

enter image description here

like image 421
Vitalii Avatar asked Mar 09 '18 08:03

Vitalii


People also ask

Where do I put environment variables in IntelliJ?

Add environment variablesFrom the main menu, select Run | Edit Configurations or choose Edit Configurations from the run/debug configurations selector on the toolbar. In the Run/Debug Configurations dialog, select a configuration you want to add the environment variables to.

How do I create an ENV file in IntelliJ?

Open settings, then select plugins In the search box search for “. env files support” and install it. After restarting IntelliJ you will have a new tab in the Run Configurations screen called EnvFile.

How do I set environment variables in IntelliJ spring boot?

run -> Edit Configurations -> edit environment variables.

What is the use of .ENV file?

The . env file contains the individual user environment variables that override the variables set in the /etc/environment file. You can customize your environment variables as desired by modifying your . env file.


1 Answers

Yes, it's totally possible to paste all environment variables at once in this screen but they need to be in a specific format.

Click on the ... button to the right of environment variables to show the dialog you have in your first screenshot.

Now you can use the Paste button but the values in your clipboard have to be in a specific format for pasting to work. In your case that clipboard info would be something like this:

APP_PORT=8080
DB_URL=jdbc:mysql...
DB_USER=javausers
DB_PASSWORD=javausers
APP_LOGGING_LEVEL=DEBUG

Try copying the value above and use the paste button (not Ctrl+v). If you don't have your data in this format you can try formatting it using a text replace tool online.

Also if you select all of the values in that dialog and click the copy button you can get the values in the same format that will work with importing. Warning: clicking Ctrl+c will not copy the values in the same format as the copy button in the dialog.

like image 99
VM4 Avatar answered Oct 04 '22 18:10

VM4