Details
Description
Name: akC45999 Date: 12/26/97
Under Solaris JDK trying to get a static field of a class with
somewhat long name (247 ASCII characters) VM ends up with
a NoClassDefFoundError (though compiler generates the corresponding
class file).
The JVMS says nothing on the limits that JDK interpreter may impose on
the length of class name.
--------------------- LongNameTest1.java
public class LongNameTest1 {
public static void main(String arg[]) {
Object x = null;
try {
x = c123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456.f;
} catch (Throwable e) {
System.out.println("Unexpected exception : " + e);
return;
}
System.out.println("Ok");
}
}
class c123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456 {
public static Object f;
}
--------------------- end of LongNameTest1.java
Output:
%jc LongNameTest1.java
%/export/ld14/java/dest/jdk1.2b3A/solaris/bin/java LongNameTest1
Unexpected exception : java.lang.NoClassDefFoundError: c123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456
%
Making the class name a character shorter results in normal execution.
JDK versions affected: all versions for Solaris.
======================================================================
======================================================================