简体   繁体   中英

Jetty + intellij idea :: add library

I get java.lang.NoClassDefFoundError when I add 3d party library to my project. I've tried add libraries to web-inf/module dependencies/server libs, but it doesn't work. What the right way to add libraries to project using jetty and idea?

It's a two step process if you're using IntelliJ 9 or higher.

Open the project structure and click on "libraries". Add the directory containing the JARs you're interested in.

Then click on "artifacts" and make sure that your libraries are in WEB-INF/lib of your deployment.

If these are JARs that Jetty's server class loader has to have before your app loads (eg JDBC driver JARs for connection pooling), you'll have to add them to the Jetty server /lib instead of putting them in your app's WEB-INF/lib.

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