简体   繁体   中英

Reference 3rd party .jar in Netbeans or Eclipse

I'm trying to work with 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".

Now the dist folder in the javabuilder zip contains javabuilder-core-1.1.0.jar and javabuilder-swing-1.1.0.jar. The lib folder contains a whole bunch of jars. 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:

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. Then I added the library in PersonApp Project -> Properties -> Compile. 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. I'm still not sure I'm doing it right in Netbeans.

Update: Argh, turns out it was the same problem in Netbeans too. I was importing it correctly, just not enough jars.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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