简体   繁体   中英

Class seems to be in Classpath, but still NoClassDefFound error (eclipse)

I am getting the java.lang.NoClassDefFoundError: net/n3/nanoxml/XMLParseException error, but the class does seem to be in the classpath.

Since it expects XMLParseException to be in net/n3 , I have added the net/n3/... folder instead of just the XMLParser because I assumed it would be looking for that hierarchy. (Although I tried it both ways, and neither worked.)

Here is the 'Referenced Libraries' sidebar: 在此处输入图片说明

And here is my Run Config: 在此处输入图片说明

Thanks for any help.

At runtime, Java will look for the class in net/n3/nanoxml/XMLParseException.class relative to the entries in the Java Build Path , whether that's a jar file or directory. So, the "net" folder would need to be underneath the entry in the Build Path, not itself be an entry in the Build Path.

It seems there are space in the path(Programming Projects should be ProgrammingProjects), and some times space will create issues. Please removing the spaces in path and give it a try!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM