Dmitry K
Dmitry K

Reputation: 1312

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?

Upvotes: 8

Views: 5473

Answers (1)

Dmitry K
Dmitry K

Reputation: 1312

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"

Upvotes: 4

Related Questions