javaintellij-ideajenv

Pointing Intellij SDK to jenv defined java home


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.


Solution

  • Reached out to the IntelliJ team and it appears that there is an open request for this feature. Currently it is not possible to so. Reference:

    1. https://intellij-support.jetbrains.com/hc/en-us/community/posts/360010575659-Pointing-IntelliJ-SDK-to-jenv?page=1#community_comment_360002997359
    2. https://youtrack.jetbrains.com/issue/IDEA-147078?_ga=2.66760616.724108090.1617223162-921036159.1616804110