分类:
2008-09-18 11:31:47
CODE:
D:\Program Files\Java\jdk1.7.0\bin>javac.exe test.java
D:\Program Files\Java\jdk1.7.0\bin>java.exe test.class
Exception in thread "main" java.lang.NoClassDefFoundError: test/class
Caused by: java.lang.ClassNotFoundException: test.class
at java.net.URLClassLoader$1.run(URLClassLoader.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:209)
at java.lang.ClassLoader.loadClass(ClassLoader.java:324)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:269)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:337)
Error: Could not find the main class.
Error: A JNI error has occurred, please check your installation and try again
代码是这样的CODE:
public class test
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
ms代码的第一行加不加public都一样。。。