我应该在我的Eclipse项目中放置一个外部JAR文件? [英] Where should I put an external JAR file in my Eclipse project?

查看:96
本文介绍了我应该在我的Eclipse项目中放置一个外部JAR文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Eclipse中创建了一个新项目,我想包括ANTLR jar文件。



你通常在哪里将jar文件放在你的项目?您是否在eclipse或普通的目录中创建源目录?那么你可以从那里引用它们吗?



我想能够轻松地传输这个项目,而不是声明对我的项目文件夹外的jar文件的引用,但我不是确定在Java世界中正常的约定是什么。



任何指导都不胜感激。

解决方案

我通常会在其中放置所有第三方JAR的/ lib目录。然后我告诉Eclipse将所有这些JAR添加到我的编译和运行时CLASSPATH。我相信它是右键单击项目,选择构建路径>库(每个Balus-C),然后修改CLASSPATH。对不起我没有更具体,但我不使用Eclipse。我更喜欢IntelliJ,但所有Java IDE的想法是一样的。


I've created a new project in Eclipse and I want to include the ANTLR jar file.

Where do you typically place your jar files before referencing them in your project? Do you create a "Source Directory" in eclipse, or a normal "Directory"? Do you then reference them from there?

I want to be able to easily transport this project around and not declare references to jar files outside my projects folder but I'm not sure what the normal convention is to do in the Java world.

Any guidance would be appreciated.

解决方案

I usually create a /lib directory in which I place all 3rd party JARs. Then I tell Eclipse to add all those JARs to my compile and runtime CLASSPATH. I believe it's right click on "project", choose "Build Path > Libraries" (per Balus-C), and then modify CLASSPATH. Sorry I'm not more specific, but I don't use Eclipse. I prefer IntelliJ, but the idea is the same for all Java IDEs.

这篇关于我应该在我的Eclipse项目中放置一个外部JAR文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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