Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ - The selected directory is not a home for JDK

Similar to this question IntelliJ, "The selected directory is not a home for JDK", I am getting an error that my JDK directory suddenly is not valid.

Intellij JDK error

Even though my JDK directory looks fine to me and worked last time I loaded IntelliJ

My JDK directory

So I am selecting a valid JDK directory and yet still I get this error.

My Version of IntelliJ

What could cause this? What could fix this?

like image 939
E.S. Avatar asked Feb 18 '16 01:02

E.S.


People also ask

How do I fix the selected directory is not a valid home for JDK?

First at all, you need to select the C:\ folder. Then, you select Program Files. After it, you select java, and finally the jdk you downloaded.

What is the home directory for JDK?

Now home directory for jdk will be: "C:\Program Files\Java\jdk1.

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

That is because of tool.jar and/or rt.jar file(s) being missed from JAVA_HOME/lib directory.

Reinstalling java can resolve this issue.

like image 196
Rao Avatar answered Oct 12 '22 13:10

Rao