In this topic
To export extension classes using the Eclipse IDE, follow these steps:
Create a manifest file (optional)
If your extension classes include reference to external libraries and external JAR files, the external dependencies must be specified in a manifest file and included in the JAR file with the corresponding Java classes. If your extension classes do not include external references, you do not need to create a manifest file.
To create a manifest file in the Eclipse IDE, follow these steps:
To create a manifest file in the Eclipse IDE, follow these steps:
- Right-click the project, click New, and click Other as shown in the following illustration:
The New wizard dialog box opens. - Select File under the General node and click Next as shown in the following screen shot:
The New File dialog box opens. - Select the project, enter a file name, and click Finish as shown in the following screen shot:
A file is created in the specified project. - List the dependent libraries and JAR files in the file under the Class-path header as follows:
Manifest-Version: 1.0
Class-Path: MyUtils.jar demo/gismath.jar
Class-Path: MyUtils.jar demo/gismath.jar
- Save the file and close it.
The manifest text file must end with a new line or carriage return to parse properly.
Create a JAR file
To create a JAR file, follow these steps:
- Select the Java extension classes, right-click and select Export from the context menu as shown in the following screen shot:
The Export dialog box opens. - Select the JAR file and click Next as shown in the following screen shot:
The JAR Export File Specification dialog box opens. - Select the project.
- Check the Export generated class files and resources check box.
- Browse to the export destination.
- Click Next.
These steps are shown in the following screen shot:
The JAR Export Packaging Options dialog box opens. - If you did not create the optional manifest file, click Finish, and go to step 10.
- If you created a manifest file, click Next as shown in the following screen shot:
The JAR Export Manifest Specification dialog box opens. - Click the Use existing manifest from workspace radio button, browse to and select the manifest file in your project, and click Finish as shown in the following screen shot:
- Go to the export destination file to verify that you successfully created a JAR file.
Export using the command line
To export a custom geoprocessing tool using the command line, follow these steps:
- Create a text file called manifest.txt with the following contents:
Manifest-Version: 1.0
Class-Path: MyUtils.jar demo/gismath.jar
Class-Path: MyUtils.jar demo/gismath.jar
- Type the following command at the command line to create a JAR file for the associated classes:
jar -cfm <jar-file-name> <manifest file name> <packagename>/*.class
- Go to the export destination file to verify that you successfully created a JAR file. Copy the JAR file to <ArcGIS Install Dir>\java\lib\ext folder.
Development licensing | Deployment licensing |
---|---|
Engine Developer Kit | Engine |
Server | Server |