Search code examples
intellij-ideajava-11

IntelliJ Does Not Recognize a JDK installation


IntelliJ has started saying about my JDK 11 installation that "The selected directory points to a JRE not a JDK". Why is that, and how can I fix it?

I have a JDK 11 and and a JDK 17 installed. I need the JDK 11 because of an old code base I need to look into. Up until today, everything worked, i.e. the JDK 11 was recognized as such and the old project ran fine with it. Not I get this error and I don't know why.

I have checked that the JDK 11 directory (C:\Program Files\Java\jdk-11) has the same directory structure as the JDK 17 next to it, it has a javac, etc.

The jdk-11\release file shows it's an Oracle "11.0.21+9-LTS-193".

MODULES="java.base java.compiler ..."

JAVA_VERSION_DATE="2023-10-17"

Why is this JDK not recognized in IntelliJ 2023.2.4 Ultimate on Windows 10?

What exactly is IntelliJ looking for to determine that a directory contains a JDK?

How can I fix this?

Update: specifying which files don't/exist:

jdk-11/bin/javac.exe    yes
jdk-11/jre/lib/rt.jar   no
jdk-11/classes          no
jdk-11/lib/jrt-fs.jar   no

The JDKs are installed via a corporate "app store", so while I have not customized the JDK distribution, corporate infrastructure service may have done so.


Solution

  • Solved by un/re/installing the JDK 11. Not sure what was missing before, but it all seems to be ok now. IntelliJ recognizes that installation as a JDK.