8

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?

Community
  • 1
  • 1
E.S.
  • 2,733
  • 6
  • 36
  • 71
  • How did you install jdk/java? – Rao Feb 18 '16 at 01:23
  • @Rao I downloaded the JDK from oracle's web site. – E.S. Feb 18 '16 at 01:33
  • Question was how did you install it? Have you just extracted the jdk directory just out of java installer file? or did you install normally following the installer wizard. – Rao Feb 18 '16 at 01:41
  • Double click and installed it as admin. I'll try reinstalling it just in case (but tomorrow, I need to wait for a process to finish) – E.S. Feb 18 '16 at 01:50
  • 1
    Can you check if you have `tool.jar`, 'rt.jar' files in JAVA_HOME/lib directory? – Rao Feb 18 '16 at 01:52
  • 1
    You were right -- somehow the `tool.jar` went missing. I am perplexed. This solved the problem though -- reinstalling JDK 1.7_80. If you submit this as your answer I will accept it. – E.S. Feb 18 '16 at 17:59

1 Answers1

6

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.

Rao
  • 20,781
  • 11
  • 57
  • 77