18.04.2015 Views

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

BUILDING APPLICATIONS WITH VISUAL JAVABEANS<br />

DEPLOYMENT<br />

To successfully deploy this application onto a user’s machine, you will create an<br />

executable JAR file. Users will then be able to launch the application by using the<br />

JRE installed as part of <strong>ArcGIS</strong> <strong>Engine</strong> <strong>Developer</strong> Kit or Runtime by giving the<br />

following command:<br />

java –jar mapviewer.jar<br />

To create an executable JAR:<br />

1. In the directory where the compiled Java class files are present, create a file<br />

called “manifest.txt”.<br />

2. Add the following single line to the manifest.txt file:<br />

Main-Class: MapViewer<br />

3. Make sure to press Enter at the end of the first line.<br />

4. Save the file and open a command window. Use the ‘cd’ command to change<br />

to the directory containing the manifest.txt file.<br />

5. Give the following command to create the executable JAR file:<br />

jar cmf manifest.txt mapviewer.jar *.class<br />

6. A mapviewer.jar file will be created. This is the executable JAR that can be<br />

launched using the JRE included as part of the <strong>ArcGIS</strong> <strong>Engine</strong> <strong>Developer</strong> Kit,<br />

as follows:<br />

"C:\Program Files\<strong>ArcGIS</strong>\java\jre\bin\java" -jar mapviewer.jar<br />

This command can be bundled in a batch file or shell script to provide a launch<br />

script.<br />

Chapter 6 • <strong>Developer</strong> scenarios • 329

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!