Intellij is showing me "The selected directory points to a JRE, not a JDK." even when the Java version I'm using is a JDK
Answered
Hello,
I installed both Java 1.8 and Java 11. However, whenever I try to add the JDK into intellij, i'm getting this error:


Please sign in to leave a comment.
Hello,
- Does it have the standard JDK layout? (e.g. lib and jmods subdirectories, etc...)
- What console output do you see from path_to_jdk/bin/java -version?
- Go to the JDK directory from the terminal and execute tree /f.
I have the same problem.
Jonas What directory do you select in the IDE when you add this JDK?
For me, I copied a JRE from JDK 8 to JDK 11 as JRE was missing in my JDK and it recognized the folder as JDK.
The answer is in https://intellij-support.jetbrains.com/hc/en-us/community/posts/360007751379-Why-does-IntelliJ-not-accept-usr-local-opt-openjdk-installed-by-Brew-as-a-JDK-
In short, don't be fooled by the short path. Use the deeper/longer path.