Duplicate :
|
|
Duplicate :
|
|
Duplicate :
|
|
Duplicate :
|
|
Duplicate :
|
|
Relates :
|
|
Relates :
|
Consider this simple test program: public class test { public static void main(String[] args) throws Exception { String[] s = new String[] { "123" }; String clName = s.getClass().getName(); test.class.getClassLoader().loadClass(clName); } } This runs fine on JDK 1.5, but throws this exception on JDK 6.0: Exception in thread "main" java.lang.ClassNotFoundException: [Ljava.lang.String; at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at test.main(test.java:7)
|