| Summary: | "Incompatible .class files version in required binaries. Project is targeting a 1.4 runtime, but is compiled against '$JAVA_HOME/jre/lib/ext/charset.jar' which requires a 1.5 runtime" and "Cannot find the class file for java.lang.Object" | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Ralf Hauser <hauser> |
| Component: | Debug | Assignee: | JDT-Debug-Inbox <jdt-debug-inbox> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | philippe_mulet |
| Version: | 3.0.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Ralf Hauser
even when I put my JAVA_HOME back to jdk1.4 when starting eclipse, I still get <<Incompatible .class files version in required binaries. Project 'p' is targeting a 1.4 runtime, but is compiled against 'C:Program Files/Java/jdk1.5.0/jre/lib/charsets.jar' which requires a 1.5 runtime>> This happens despite the windows-preferences-java-installed_jres has the 1.4.02_05 checked. So, only removing the unchecked 1.5 JRE !!AND!! restarting eclipse again got the errors away from the Problems list. Now, I get <<The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project>> - similar but not exactly like Bug 67414 P.S.: I had 1.5 working nicely for weeks until I ran into this obscure dependency Philippe, can you shed some light on this. And I also get back the errors that refer to the 1.5 jre. Also, setting the machine's Windows Environment variable back to 1.4 doesn't fix it - it still remembers the 1.5 paths... despite doing Project-Clean with "start rebuild immediately" checked. In the Project's build-path, there was an "unbound" JRE System Library. Removing it and re-adding the 1.4 one did solve the charset.jar related 1.5 error messages, but did not fix the missing java.lang.Object figured out that java.lang.Object.class is in rt.jar. in windows-preferences-java-build_path-classpath_variables there is a JRE_LIB (reserved) pointing to the rt.jar, but this apparently had no effect. When finally adding the rt.jar manually to the project-property-Java_Build_Path again, I got it to compile again... (But I guess this is a dirty fix not in the intention of the eclipse architects) P.S.: One good way to test for where the mistaken references to the wrong jre are is to use window-preferences and there press the export button. Opening the created preferences.epf file as text and searching it gives a lot of insight... As you probably figured, this warning is configurable (see Preferences>Java>Compiler>Building>Incompatible required binaries). Its intent is to flag cases where you compile code with a certain VM target (here 1.4) but required some binaries on the classpath which would require a higher VM target (here 1.5). This is likely asking for trouble when this happens. In the particular scenario of this defect, it looks like the JRE container resolution got confused somehow. Passing on to JRE container owner. Any steps to reproduce this error? Marking as won't fix without clear/simple steps to reproduce. It looks the problem has been worked-around. |