IntelliJ - The selected directory is not a home for JDK

8.4k Views Asked by At

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?

1

There are 1 best solutions below

0
On BEST ANSWER

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.