Pointing Intellij SDK to jenv defined java home

3.5k Views Asked by At

I am using jenv to set the java home. It works fine and points to the correct JAVA_HOME when I do echo $JAVA_HOME.

My question is how do we set Intellij to get the SDK pointed by JAVA_HOME without having to go through the project SDK route.

Output of:

echo $JAVA_HOME
/Users/jetfire/.jenv/versions/ibm64-15.0.1
java -version
openjdk version "15.0.1" 2020-10-20
OpenJDK Runtime Environment AdoptOpenJDK (build 15.0.1+9)
Eclipse OpenJ9 VM AdoptOpenJDK (build openj9-0.23.0, JRE 15 Mac OS X amd64-64-Bit Compressed References 20201024_81 (JIT enabled, AOT enabled)
OpenJ9   - 0394ef754
OMR      - 582366ae5
JCL      - ad583de3b5 based on jdk-15.0.1+9)

I feel the closest related answer is from here https://stackoverflow.com/a/33559424

However I don't think I should be setting java_home as it is already setup by jenv.

2

There are 2 best solutions below

0
graphEnthusiast On BEST ANSWER
2
ALex On

You don't need any variables set up. The link you provided has the answer. When you click the + button use the path that you've posted here /Users/jetfire/.jenv/versions/ibm64-15.0.1

I'm using sdkman so it's basically the same enter image description here