JDK classes not found even though Project JDK has been defined

As can be seen from the attached images, the project jdk has been defined: yet java.lang class is not found.  

this is latest version 9.0.2 downloaded today.

I have been experiencing this issue for some time. The workaround is to manually add the jre classes to the project. That's a real hack though.



Attachment(s):
compilationError.jpg
ijProjectCompiler.jpg
3 comments
Comment actions Permalink

Hi Stephen,

Please make sure that:

  1. Your JDK configuration is valid - click 'Edit' button at project settings dialog (next to JDK selection combo box) and ensure that rt.jar is configured for it;
  2. Open target module settings and ensure that it uses correct project-level JDK ('Dependencies' tab, 'Module SDK' combo box);


Reagrds, Denis

0
Comment actions Permalink

Denis, sure I could attach rt.jar. But why doesn't IJ just find the  requisite jars itself?  Why do I have to attach them?

0
Comment actions Permalink

javadba wrote:

Denis, sure I could attach rt.jar. But why doesn't IJ just find the  requisite jars itself?  Why do I have to attach them?

The point was to ensure that your jdk configuration is correct, not to attach the jars manually.

Basically, all you need for jdk setup is to point IDEA to jdk home to use, it does all the job automatically (picks up the jars and configures sources).

0

Please sign in to leave a comment.