Setting up environment variables in IntelliJ using WSL

1.2k Views Asked by At

I am using IntelliJ 2021.2.1 on Windows 10 on a project that runs in WSL2 > Ubuntu

My project is set so that it fails to run if the environment variables are not set.

If I go to Settings > Terminal , there is an option to set environment variables. I added them using the pattern: VAR1=VALUE1;VAR2=VALUE2 .

enter image description here

They seem to be loaded correctly as they are listed on the Environment Variables dialog.

enter image description here

When I run the project using IntelliJ, it opens on the IntelliJ terminal, but the project fails to run because the variables are not set.

Is there something I'm missing from the configuration?

1

There are 1 best solutions below

0
CrazyCoder On BEST ANSWER

It's a known bug in IntelliJ IDEA.