当前位置: 技术问答>java相关
问:程序运行时碰到java.lang.NoClassDefFoundError的出错原因
来源: 互联网 发布时间:2015-07-05
本文导语: 我在运行java and xml这本书中的例子 SAXParserDemo.java遇到如下错误(运行时): Exception in thread "main" java.lang.NoClassDefFoundError: ch03/SAXParserDemo 我不知道原因,望高手指点,我检查过文件名和类名是一样的。 ...
我在运行java and xml这本书中的例子 SAXParserDemo.java遇到如下错误(运行时):
Exception in thread "main" java.lang.NoClassDefFoundError: ch03/SAXParserDemo
我不知道原因,望高手指点,我检查过文件名和类名是一样的。
Exception in thread "main" java.lang.NoClassDefFoundError: ch03/SAXParserDemo
我不知道原因,望高手指点,我检查过文件名和类名是一样的。
|
set your classpath =.;c:xercesxercesImpl.jar;c:xercesxmlParserAPIs.jar;c:yourworkfolder
then put the sample files SAXParserDemo.java in the c:yourworkfolder, then comple the *.java files(javac SAXParserDemo.java) ,then run the class files(java SAXParserDemo)
then put the sample files SAXParserDemo.java in the c:yourworkfolder, then comple the *.java files(javac SAXParserDemo.java) ,then run the class files(java SAXParserDemo)
|
check your SAXParserDemo.java, it may be package in ch03
then you must put the cho3SAXParserDemo.java in your work folder
then at c:yourworkfolder> java cho3.SAXParserDemo
good luck!
then you must put the cho3SAXParserDemo.java in your work folder
then at c:yourworkfolder> java cho3.SAXParserDemo
good luck!