Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA adding JDK 10: “The selected directory is not a valid home for JDK”

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.

like image 628
Anders Rabo Thorbeck Avatar asked Jun 05 '18 12:06

Anders Rabo Thorbeck


People also ask

Where is a valid home for JDK?

For Windows, apparently the JDK has to be under C:\Program Files.

How do I point to JDK in IntelliJ?

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).

Where is JDK version in IntelliJ?

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.


1 Answers

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.

like image 107
Anders Rabo Thorbeck Avatar answered Oct 19 '22 15:10

Anders Rabo Thorbeck