I'm creating this question only because the duplicate questions I found were marked with Windows and Ubuntu respectively, whereas I am experiencing this issue on macOS
I have IntelliJ Ultimate 2017.2 installed, with JDK 8 added, and want to add JDK 10. After downloading and installing Oracle's JDK 10, and attempting to add /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home
as a new JDK to IntelliJ, I got the error message
The selected directory is not a valid home for JDK
despite the fact that the path and file permissions of this JDK 10 directory were seemingly all aligned with the JDK 8 ones.
For Windows, apparently the JDK has to be under C:\Program Files.
If the necessary JDK is already defined in IntelliJ IDEA, select it from the SDK list. If the JDK is installed on your computer, but not defined in the IDE, select Add SDK | JDK, and specify the path to the JDK home directory (for example, /Library/Java/JavaVirtualMachines/jdk-12.0. 1. jdk).
IntelliJ stores the JDK version used by the project within its Project Structure. There are two ways to locate this: Via menu navigation: Navigating to File -> Project Structure.
It turned out that upgrading to the newest IntelliJ IDEA version was (for some reason) what was required. After installing IDEA 2018.1, I was able to add JDK 10 without issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With