标题: 执行javac时,提示could not find the main class program will exit [打印本页] 作者: yesecongcong 时间: 2014-8-2 15:21 标题: 执行javac时,提示could not find the main class program will exit 首先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.