java编译出错——环境变量缺失导致

D:\JavaTest>java HelloWord
Exception in thread "main" java.lang.NoClassDefFoundError: HelloWord
Caused by: java.lang.ClassNotFoundException: HelloWord
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: HelloWord. Program will exit.

正确环境变量配置为:
%JAVA_HOME%\jre\lib\rt.jar;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;

posted on 2016-03-14 19:41  揉碎的青春  阅读(529)  评论(0编辑  收藏  举报

导航