简体   繁体   English

Netbeans或Eclipse中的参考3rd party .jar

[英]Reference 3rd party .jar in Netbeans or Eclipse

I'm trying to work with javabuilders ( code.google.com/p/javabuilders ). 我正在尝试使用javabuilders( code.google.com/p/javabuilders )。 To create their sample project, the tutorial states "Add the Swing JavaBuilder jar and all of its dependencies (from the “/lib” folder) to the project's build path". 要创建其示例项目,本教程指出“将Swing JavaBuilder jar及其所有依赖项(从“ / lib”文件夹中添加到项目的构建路径中)”。

Now the dist folder in the javabuilder zip contains javabuilder-core-1.1.0.jar and javabuilder-swing-1.1.0.jar. 现在,javabuilder zip中的dist文件夹包含javabuilder-core-1.1.0.jar和javabuilder-swing-1.1.0.jar。 The lib folder contains a whole bunch of jars. lib文件夹包含一堆jar。 I'm not sure how to add and properly reference these jars. 我不确定如何添加和正确引用这些罐子。 A class in the person.app package is supposed to import the library as follows: person.app包中的类应按以下方式导入库:

import org.javabuilders.BuildResult;
import org.javabuilders.annotations.DoInBackground;
import org.javabuilders.event.BackgroundEvent;
import org.javabuilders.event.CancelStatus;
import org.javabuilders.swing.SwingJavaBuilder;

In Netbeans, I tried Tools->Add Library and then added the jars to the classpath. 在Netbeans中,我尝试使用“工具”->“添加库”,然后将jar添加到类路径中。 Then I added the library in PersonApp Project -> Properties -> Compile. 然后我在PersonApp项目->属性->编译中添加了库。 That didn't work. 那没用。

Could you please give me the steps to include the jars, and then the names I can import them by? 您能否给我一些步骤,包括这些罐子,然后输入可以导入它们的名称?

I realized that in Eclipse, I was importing the jars correctly (Project -> Properties -> Java Build Path -> Libraries -> Add External JARs), I just hadn't imported one of the required jars. 我意识到在Eclipse中,我正确地导入了jars(项目->属性-> Java构建路径->库->添加外部JARs),我只是没有导入所需的jars之一。 I'm still not sure I'm doing it right in Netbeans. 我仍然不确定我在Netbeans中是否做对了。

Update: Argh, turns out it was the same problem in Netbeans too. 更新: Argh,原来这也是Netbeans中的同样问题。 I was importing it correctly, just not enough jars. 我正确地导入了它,只是罐子不够。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM