From the main menu, select File | Project Structure | Project Settings | Project. If the necessary JDK is already defined in IntelliJ IDEA, select it from the SDK list.
In macOS, the JDK installation path is /Library/Java/JavaVirtualMachines/jdk-10. jdk/Contents/Home . The root directory of the JDK software installation.
If you are on Mac OS X or Ubuntu, the problem is caused by the symlinks to the JDK. File | Invalidate Caches should help. If it doesn't, specify the JDK path to the direct JDK Home folder, not a symlink.
Invalidate Caches menu item is available under IntelliJ IDEA File menu.
Direct JDK path after the recent Apple Java update is:
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
In IDEA you can configure the new JSDK in File | Project Structure, select SDKs on the left, then press [+] button, then specify the above JDK home path, you should get something like this:
Just tried this recently and when trying to select the JDK... /System/Library/Java/JavaVirtualMachines/
appears as empty when opening&selecting through IntelliJ. Therefore i couldn't select the JDK...
I've found that to workaround this, when the finder windows open (pressing [+] JDK) just use the shortcut Shift + CMD + G to specify the path. (/System/Library/Java/JavaVirtualMachines/1.6.0.jdk
in my case)
And voila, IntelliJ can find everything from that point on.
The JDK path might change when you update JAVA. For Mac you should go to the following path to check the JAVA version installed.
/Library/Java/JavaVirtualMachines/
Next, say JDK version that you find is jdk1.8.0_151.jdk
, the path to home directory within it is the JDK home path.
In my case it was :
/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home
You can configure it by going to File -> Project Structure -> SDKs
.
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