简体   繁体   中英

java.lang.NoClassDefFoundError: org/htmlparser/util/ParserException

I'm trying to make this http://htmlparser.sourceforge.net/ code run in eclipse. There instructions are simply "To use the library, you will need to add either the htmllexer.jar or htmlparser.jar to your classpath when compiling and running."

I've added htmllexer.jar and htmlparser.jar to my build path and everything compiles fine. But at runtime eclipse can't seem to find those jar files. I'm not sure how to add those jar files to the runtime classpath....

My eclipse looks like this: 在此处输入图片说明

For a web project you have to drop those libraries straight in the /WEB-INF/lib folder of the project. This folder participates in webapp's default runtime classpath. In Eclipse, you don't need to fiddle with the build path properties this way, Eclipse will do all the necessary magic. Don't forget to undo the changes you made before.

If I understand well, you are creating a web application. In that case, you have to configure properly the Deployment assembly section of your project properties.

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