Jetty + intellij idea :: add library

孤街醉人 提交于 2019-12-10 18:46:16

问题


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?


回答1:


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 (e.g. 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.



来源:https://stackoverflow.com/questions/5078773/jetty-intellij-idea-add-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!