Community
Participate
Working Groups
The Eclipse compiler can cause a java.lang.NoClassDefFoundError: ava/lang/String (not 'java/lang/String') when the compiled class is exeuted. This test class demonstrates the bug: public class TestEclipseCompiler { public static void main(String[] args) { boolean test = true; cells(new String[] {""}[0], (test ? "" : "")); } private static void cells(String s, String s2) { } } Running 'TestEclipseCompiler' causes the Error: Exception in thread "main" java.lang.NoClassDefFoundError: ava/lang/String (This Error does not occur when using javac/JDK 1.6)
Could you please provide the build id? I could not reproduce with 3.2.2 or HEAD.
I use Eclipse Build id: M20060921-0945 and java version "1.6.0_01" Java(TM) SE Runtime Environment (build 1.6.0_01-b06) Java HotSpot(TM) Server VM (build 1.6.0_01-b06, mixed mode)
Cannot reproduce either. Are you using a vanilla Eclipse install ? Could you attach the classfile for TestEclipseCompiler ?
Reproduced with 3.2.1 (which corresponds to your build id). This is a dup of bug 169596. It is a consequence of not handling properly the anewarray bytecode. When aaload is used, the class name is not properly truncated. *** This bug has been marked as a duplicate of bug 169596 ***