4

I installed openjdk 1.7.0 and set it up in IntelliJ 10.5

When I compile (anything) I get the error "Fatal Error: Unable to find package java.lang in classpath or bootclasspath".

I looked at this question: IntelliJ gives Fatal Error: Unable to find package java.lang in classpath or bootclasspath but all jar files inside the lib directory are already added.

Community
  • 1
  • 1
mitch
  • 282
  • 2
  • 7

3 Answers3

3

Ok. I was wrong there weren't all jars added. I found some more in (sub)directories other than 'lib'. After adding all those manually everything is fine. Seems like even IDEA 10.5.2 does not like the structure in openJDK yet.

mitch
  • 282
  • 2
  • 7
  • Please file a request at http://youtrack.jetbrains.net/issues/IDEA and specify which jars were not added. – CrazyCoder Aug 05 '11 at 13:15
  • Can you include which jars you had to add, to help others who may have the same problem? And mark your own answer as the solution to remove it from the queue? – CrackerJack9 Aug 21 '11 at 15:26
  • 1
    I ran into the same issue with IntelliJ 10.5.4 and JDK 7u5, it seems that neither [IDEA-69833](http://youtrack.jetbrains.com/issue/IDEA-69833) nor [IDEA-74442](http://youtrack.jetbrains.com/issue/IDEA-74442) were backported to 10.5. Anyway, [Oracle's description](http://www.oracle.com/technetwork/java/javase/downloads/jdk-for-mac-readme-1564562.html) has at least an image showing which files are needed (in section "use this JDK with IntelliJ IDEA 11 CE") – Robin Jul 13 '12 at 08:55
2

Try IDEA 10.5.2. Make sure that JDK path is not a symlink. If the issue remains, specify your OS and attach a screenshot of JDK classpath configured in IDEA.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
2

I had the same problem. I added all jar files in the following directories manually:

  • /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/1.7.0.jre/Contents/Home/lib
  • /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/1.7.0.jre/Contents/Home/lib/ext
Cliffred
  • 21
  • 1