首先Eclipse能正常运行程序
命令行窗口执行java 123.java 命令也能生成class 文件,但是执行java 123时就提示:
Exception in Thread "main" java.lang.NoClassDefFoundError:123
Caused by: java.lang.ClassNotFoundException: 123
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:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: 123. Program will exit.
环境变量已经配置了,javahome=C:\Program Files (x86)\Java\jdk1.6.0_10\
path=.;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files (x86)\Common Files\Adobe\AGL;%java_home%\bin;%java_home%\jre\bin
%java_home%\jre\bin
classpath=.;%java_home%lib;%java_home%\lib\tools.jar
各种百度,也没弄明白,想卸载了重新安装,但是还是想搞明白这是怎么回事,大神给讲解讲解
|
|