package file;
import java.util.*;
public class Test {
public static void main(String[] args) throws Exception{
System.out.println("i love you");
}
}
文件命令如下
javac -d f: test.java
set classpath=f:
java file.Test
会显示i love you
但是如果设置,set classpath=f:\file;
java Test;
则会显示:Exception in thread "main" java.lang.NoClassDefFoundError: Test (wrong
e/Test)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoad
4)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.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:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:27
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:31
我想知道为什么这样我的第二次操作会抛出异常,难道这样执行错误了??
请教了,想非常详细的了解java命令,请教了?