Bug 110826

Summary: [compiler] Batch compiler doesn't work when set on the bootclasspath
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: 3.1.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix none

Description Olivier Thomann CLA 2005-09-27 12:08:39 EDT
When compiling code that needs to report error messages, the batch compiler
blows up with this error:
Exception in thread "main" java.lang.NoClassDefFoundError
        at
org.eclipse.jdt.internal.compiler.Compiler.handleInternalException(Compiler.java:399)
        at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:348)
        at
org.eclipse.jdt.internal.compiler.batch.Main.performCompilation(Main.java:2728)
        at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:1166)
        at org.eclipse.jdt.internal.compiler.batch.Main.main(Main.java:1071)

This comes from the Messages class that doesn't support its field initialization
when loaded from the system class loader (this is the consequence of having the
compiler classes on the bootclasspath).

To reproduce, use the following command line:
java -Xbootclasspath/a:org.eclipse.jdt.core_3.1.0.jar
org.eclipse.jdt.internal.compiler.batch.Main  X.java

When X is:
public class X {
    ZORK f;
}
Comment 1 Olivier Thomann CLA 2005-09-27 12:19:27 EDT
Created attachment 27563 [details]
Proposed fix
Comment 2 Philipe Mulet CLA 2005-09-27 12:34:32 EDT
+1 for 3.1.1
Comment 3 Olivier Thomann CLA 2005-09-27 13:10:15 EDT
Fixed and released in 3.1.1 maintenance stream.
No specific regression tests. Try to run the command line in comment 0.
Comment 4 Olivier Thomann CLA 2005-09-27 15:33:26 EDT
Verified in  M20050923-1430 + JDT/Core 3.1.1RC3 candidate