Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting Intellij IDEA from icon on linux: No JDK found

I am using Linux Mint and trying to run Intellij IDEA from icon on the start menu. Starting Intellij via terminal ./idea.sh works fine. However launching from icon (points to the same ./idea.sh) ends up with following error:

No JDK found. Please validate either IDEA_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation.

Running echo $JAVA_HOME and java -version works correctly and shows installed JDK. How can I fix this issue and why starting from icon differs from starting from terminal?

like image 362
Dmitry Kach Avatar asked Mar 08 '18 15:03

Dmitry Kach


1 Answers

As @lealceldeiro and @millimoose pointed out, SDKMAN exposes JAVA_HOME every time terminal is launched. That is why JAVA_HOME was unavailable from other places. All I had to do is add JAVA_HOME to /etc/environment manually:

JAVA_HOME="/home/dmkach/.sdkman/candidates/java/current"
like image 191
Dmitry Kach Avatar answered Nov 19 '22 03:11

Dmitry Kach