在 netbeans 中添加其他项目作为库 [英] add other projects as library in netbeans
问题描述
我有一个项目 A(例如一个基于 Ant 的 Java 应用程序项目)和第二个项目 B(一个 Java 类库项目或另一个 Java 应用程序项目,均基于 Ant 构建.)
I have a project A (for example an Ant based Java Application project) and a second project B (a Java Class Library project or another Java Application project, both Ant build based.)
项目 B 有一些额外的 Java 库依赖项(Libraries 文件夹中的 .jar 文件).
Project B has some additional Java library dependencies (.jar files in the Libraries folder).
A 依赖于 B.A 可以使用自己在 B 中编写的类,但除非我将这些库/jar 文件添加到 A,否则它看不到 B 附加库中的类.
A depends on B. A can use classes which are written by myself in B but it can not see classes in the additional libraries of B unless I add those libraries/jar files to A.
有没有办法让 NetBeans 自动管理 A 中的库依赖项,除了包含 B 自己的 jar 文件之外,还包含 B 的依赖项?在eclipse中,当你在项目B中添加.jar文件时,不需要再次添加到A中.
Is there a way to get NetBeans to automatically manage the library dependencies in A by including the dependencies of B in addition to B's own jar file? In eclipse when you add .jar files to project B, it is not necessary to add them to A again.
谢谢.
推荐答案
在您的项目文件夹中,您应该看到一个名为 Dependencies
的文件夹,右键单击该文件夹并选择 Add Dependency...
.打开 Open Projects
标签;从那里您可以从列表中选择您的项目.点击添加
.
In your project folder you should see a folder called Dependencies
, right click on that folder and choose Add Dependency...
. Open the Open Projects
tab; from there you can select your project from the list. Click Add
.
这适用于 NetBeans IDE 7.2.1.
This works for NetBeans IDE 7.2.1.
这篇关于在 netbeans 中添加其他项目作为库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!