Terminal inside IntelliJ is not picking up latest JAVA_HOME variable value after Java update.

Answered

After automatic Java Update of my windows system, I changed my JAVA_HOME and PATH environement variables to point to valid Java installation but the same is not reflected in the terminal inside intellij which is pointing to cmd.exe.


The issue doesn't disappear after restart.
Please help.

8 comments
Comment actions Permalink

Try to logout and login again.

0
Comment actions Permalink

Hello Serge,

I would like to switch between java versions (OSX) back and forth. I expect that it shall be enough to set the jdk version in "Project Settings" -> "Project SDK". This approach does not work in Ultimate 2020.2. Both JAVA_HOME env var and java version in IntelliJ console are unaffected by what is set in "Project Settings".

 

What is the correct approach?

 

Best regards,

Anatoly

 

0
Comment actions Permalink

Project JDK doesn't affect Terminal tool window environment. The only way to change it is via your system environment settings: https://stackoverflow.com/a/26586170/104891.

0
Comment actions Permalink

I'm facing the same under IntelliJ IDEA 2020.3 (Ultimate Edition).

What does it mean "Try to logout and login again" ?

Does it mean to try to sign out your os user account? 

 

0
Comment actions Permalink

> Does it mean to try to sign out your os user account? 

Yes. It is needed to reload environment variables. 

 

1
Comment actions Permalink

In my case on Ubuntu it didn't help. Finally, I set the variable from the terminal inside IntelliJ and it worked.

0
Comment actions Permalink

Prussaq How did you set it in Ubuntu so that IDE didn't pick it up?

0
Comment actions Permalink

Serge Baranov Sorry, I did it wrong, not in /etc/profile. So after logout/login it didn't work. I think the thread can be deleted. Thank you!

0

Please sign in to leave a comment.