exception in thread 'main' java.lang.NoClassDefFoundError:

Exception in thread "main" java.lang.NoClassDefFoundError
转载自http://stackoverflow.com/questions/6334148/exception-in-thread-main-java-lang-noclassdeffounderror?answertab=votes#tab-top

One of the places java tries to find your .class file is your current directory. So if your .class file is in C:\java, you should change your current directory to that.

To change your directory, type the following command at the prompt and press Enter:

cd c:\java  

This . tells java that your classpath is your local directory.

Executing your program using this command should correct the problem:
java -classpath .HelloWorld
posted @ 2013-07-10 13:49  viltran  阅读(589)  评论(0编辑  收藏  举报