Jetty + intellij idea ::添加库 [英] Jetty + intellij idea :: add library

查看:220
本文介绍了Jetty + intellij idea ::添加库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将3d派对库添加到项目中时,我得到 java.lang.NoClassDefFoundError
我已经尝试将库添加到web-inf /模块依赖/服务器库,但它不起作用。使用jetty和idea将项库添加到项目的正确方法是什么?

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?

推荐答案

如果您使用IntelliJ,这是一个两步的过程9或更高。

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

打开项目结构并单击库。添加包含您感兴趣的JAR的目录。

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

然后单击artifacts并确保您的库位于部署的WEB-INF / lib中。

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

如果这些是Jetty的服务器类加载器在加载应用程序之前必须具有的JAR(例如用于连接池的JDBC驱动程序JAR),则必须将它们添加到Jetty服务器/ lib而不是将它们放在你的应用程序的WEB-INF / lib中。

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.

这篇关于Jetty + intellij idea ::添加库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆