I am trying to get started with IntelliJ IDEA, however I am not able to set the JDK path. which java
returns /usr/bin/java, however IDEA is not able to find the specified path. Expanding bin in the tree from within IDEA shows an unending tree of X11. I also tried /usr/share/java, but that gives an error 'specified path not a directory for JDK'
How do I set the JDK path?
Ubuntu – Unable to set JDK path in IntelliJ IDEA
intellijjavajdk
Related Question
- Ubuntu – Intellij idea not opening because of jdk/bin/java
- Ubuntu – Intellij Idea Community Edition, cannot set `Gradle home`
- Ubuntu – Cannot find “valid home for jdk” in intellij idea
- Ubuntu – intelliJ doesn’t accept java 9 JDK
- Ubuntu – Location of Intellij Idea 2017.1 on ubuntu 16.04
- Ubuntu – In IntelliJ from snap I can’t select openJDK 11 from apt-get
Best Answer
The error message is quite clear:
/usr/bin/java
it is not a directory to JDK is command for running compiled java programs.class
files.For setup JDK in IntelliJ go to
Project Structure
in sectionPlatform Settings
chooseSDKs
and add path to JDK usually on Ubuntu it installed in/usr/lib/jvm/
. After that in sectionProject Settings
chooseProject
tab and finally select added JDK: