IntelliJ cannot find the JDK inside of conda env

Answered

So, I am working on a project that is primarily in Python, but is using Java as it's simulator. My python script will create and then destroy java simulators and communicate to it via pipes. For the most part, I've been able to treat the Java code like a black-box until recently.

When I install the project, creating my conda environment will also download and use a copy of openJDK 11.0.1 that is local to my conda env. 

When I installed IntelliJ, not only will it install its own JDK, overshadow the one that I manually install inside of my conda-env, but IntelliJ cannot seem to find it. 

 

I have the exact path to where conda is placing java:

/home/aadharna/miniconda3/envs/thesis/bin/java

This JDK is gotten from here: https://anaconda.org/conda-forge/openjdk

 

But when I try to go there and set IntelliJ's JDK to that, I get the following error: 

0
5 comments

IntelliJ IDEA requires the standard JDK layout directory location which is usually referred as JAVA_HOME, it's not just the binary java executable, unlike python configuration.

0
Avatar
Permanently deleted user

So, what I downloaded from conda-forge wasn't the full JDK, it was just an executable of java 11? (Which IntelliJ should also come installed with, even though the JDK in the image above is saying 1.8, correct?)

0

The full JDK may be in a different folder and java is just a binary symlink into a common location.

0

IntelliJ IDEA doesn't come with JDK, it's using JetBrains Runtime which is not suited for development. You need to install JDK yourself. JDK 1.8 is configured from your system, it's not bunded.

0
Avatar
Permanently deleted user

So, I did a `find -type d -name java` call from the base of conda, but none of the response that the call returned me were accepted by IntelliJ. 

I also ran another call with `find -type d -name jvm` to try to match `/usr/lib/jvm` since that's where IntelliJ is originally looking, but that came up blank. 

Something has to be in the conda directory otherwise the code couldn't work, and I've done complete instillation on virgin systems that didn't have Java and the conda-openJDK would work. When I tried to `readlink` the java binary that's in the conda env, it pointed me back at the same file I was trying to find. 

 

Regardless, this seems like an issue I should take up with conda rather than jetbrains at this point. 

 

Thanks for pointing me in a direction. 

0

Please sign in to leave a comment.