开发者

Where should I put an external JAR file in my Eclipse project?

I've created a new project in Eclipse a开发者_如何学Gond 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜