18.04.2015 Views

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

JAVA APPLICATION PROGRAMMING INTERFACE<br />

On Windows, your path should include ...\<strong>ArcGIS</strong>\bin.<br />

ESRI recommends setting an ARCENGINEHOME environment variable.<br />

Although this is not a requirement to use the <strong>ArcGIS</strong> <strong>Engine</strong> <strong>Developer</strong> Kit, the<br />

developer samples all use this variable to ensure your class path settings are accurate.<br />

On Solaris and Linux, ARCENGINEHOME and all required <strong>ArcGIS</strong> paths are<br />

set by sourcing one of the init_engine scripts.<br />

• When using C-shell, use this command:<br />

source /path/to/arcgis/init_engine.csh<br />

• When using bash or bourne shell, use this command instead:<br />

source /path/to/arcgis/init_engine.sh<br />

Setting the ARCENGINEHOME variable on Windows:<br />

ARCENGINEHOME=[path to <strong>ArcGIS</strong> install directory]<br />

For example:<br />

ARCENGINEHOME=c:\<strong>ArcGIS</strong><br />

Editing the path enables your system to use the native resource libraries that ship<br />

with the <strong>ArcGIS</strong> <strong>Engine</strong> Runtime. Edit the PATH directory to include the<br />

jre\bin directory of ARCENGINEHOME.<br />

On Windows:<br />

PATH=...;%ARCENGINEHOME%\java\jre\bin<br />

Class path<br />

The <strong>ArcGIS</strong> API for Java provides Java Archive (JAR) files and the native<br />

runtime libraries. These JAR files are located on disk at<br />

%ARCENGINEHOME%\java on Windows and $ARCENGINEHOME/java<br />

on Solaris and Linux.<br />

All Java applications built with any of the <strong>ArcGIS</strong> developer kits must have the<br />

jintegra.jar file referenced in the respective application’s class path. This file<br />

contains all of the class files for the runtime library that handle interoperability to<br />

COM.<br />

In addition, individual arcgis_xxx.jar files should be added to your class path as<br />

needed. For example, applications that leverage the PageLayout bean included<br />

with ArcObjects require that the arcgis_pagelayoutbean.jar file be added to the<br />

class path.<br />

As an optional convenience, you can use the JARs in<br />

%ARCENGINEHOME%\java\opt or $ARCENGINEHOME/java/opt instead<br />

of a long list of arcgis_xxx.jar files. These two convenience JARs are:<br />

• arcobjects.jar—contains all of the non-UI class files in one complete archive.<br />

• arcgis_visualbeans.jar—contains all of the UI class files in one complete<br />

archive.<br />

ANT<br />

The <strong>ArcGIS</strong> SDK for Java includes numerous sample applications, each of which<br />

is delivered with ANT scripts. ANT is a Java-based build tool that uses build<br />

Chapter 4 • <strong>Developer</strong> environments • 183

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

Saved successfully!

Ooh no, something went wrong!