Microsoft Windows 2000 [Version 5.00.2195] (C) 版权所有 1985-1998 Microsoft Corp. C:\>javac HelloWorld.java C:\>java HelloWorld Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld C:\> |
class HelloWorld { public static void main(String[] args) { // Display "Hello World!" System.out.println("Hello World!"); } } |
java_home=c:\jdk130 (安装路径) classpath=.;C:\jdk13\lib\tools.jar;C:\jdk13\lib\dt.jar;C:\jdk13\bin; path= C:\jdk13\bin; |
set classpath=.;C:\jdk13\lib\tools.jar;C:\jdk13\lib\dt.jar;C:\jdk13\bin; |
Exception in thread "main" java.lang.NoClassDefFoundError: Hello (wrong hello/Hello) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:486) at java.security.SecureClassLoader.defineClass(SecureClassLoader. 1) at java.net.URLClassLoader.defineClass(URLClassLoader.java:248) at java.net.URLClassLoader.aclearcase/" target="_blank" >ccess0(URLClassLoader.java:56) at java.net.URLClassLoader.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:297) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286) at java.lang.ClassLoader.loadClass(ClassLoader.java:253) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313) |