IntelliJ - The selected directory is not a home for JDK

E.S. picture E.S. · Feb 18, 2016 · Viewed 8.4k times · Source

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?

Answer

Rao picture Rao · Feb 18, 2016

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.