/ INTELLIJ, JAVA

Pains with Java

So I’ve spent the last hour trying to solve an elusive error in my project:

"Fatal Error: Unable to find package java.lang in classpath or bootclasspath"

I use IntelliJ 9. At one time I could build the project with no problem. Then one day it just stopped. I finally found the solution.

Here is what I did

  • Open Project Structure from file menu
  • Under Platform Settings select SDKs
  • For the Classpath tab, I clicked add and included

    %JAVA_HOME/jre/lib/rt.jar

Hope this helps.