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.java

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

cd c:\java 

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

Executing your program using this command should correct the problem: java -classpath .HelloWorld
相關文章
相關標籤/搜索