You can include classes from other compiled JAR files
in your application. To include these files, save the JAR file in
a new project in the same workspace as your application. Make this
new project a library application and make your application dependent
on this library. You can then import all of its classes. The following
steps make up this procedure.
To create a new project
- Open the workspace that contains your application's
project.
- Create a new project.
To add a compiled JAR file to the project
- In the navigation pane, select the project.
- On the Build menu, select Project > Add
File to Project.
- Select the appropriate JAR file and click Open.
To make the project a library
- In the navigation pane, select the project.
- Right-click and select Properties. The <Project
name> Class Properties window appears.
- Click the Application tab.
- From the Project Type drop-down list, select Library.
To compile the project
- In the navigation pane, select the project.
- Right-click and click Build Project.
To make the project dependent on the new library
- In the navigation pane, select the project.
- Right-click and click Project Dependencies.
The Class depends on <Project name:> window
appears.
- Select the <Project name> check box.
Your application can now import the classes in this JAR file
with the import “xxx.yyy.*” command.