Install and set up
Before installing the API, make sure your development machine meets the system requirements.
An app built with ArcGIS Runtime API for Java requires the following dependencies:
- The
arcgis-java
jar - ArcGIS Runtime jniLibs, resources, and required libraries
- OpenJFX 11 modules
There are three ways to get set up with the API:
- Gradle
- Maven
- Downloaded .zip file
Get the API with Gradle
The buildscript below shows how to get these dependencies using the Gradle build tool.
For a starter project using Gradle with instructions for Eclipse and IntelliJ, download or clone the java-gradle-starter-project on GitHub.
Run the Gradle copyNatives task. This will unpack the libraries into $USER_HOME/.arcgis. The API will automatically look in this directory to find the required libraries.
Configure the libraries
For your app to run, the API must be able to find the API's required libraries. If you got the API using Gradle, the libraries have been downloaded to your user directory in the .arcgis folder. Since the API can automatically find the required libraries at this location, no further configuration is necessary.
Get the API with Maven
The pom file below shows how to get the required dependencies using the Maven build tool.
For a starter project using Maven with instructions for Eclipse and IntelliJ, download or clone the java-maven-starter-project on GitHub.
Run the Maven dependency:unpack goal. This will unpack the required libraries into $USER_HOME/.arcgis
.
Configure the libraries
For your app to run, the API must be able to find the required libraries. If you got the API using Maven, the libraries have been downloaded to your user directory in the ~/.arcgis
folder. Since the API can automatically find the libraries at this location, no further configuration is necessary.
Getting the API manually
If you don't want to use a build tool like Gradle or Maven, you can download and set up the dependencies manually.
For a starter project using the API .zip file with instructions for Eclipse and IntelliJ, download or clone the java-zip-starter-project on GitHub.
For the ArcGIS Runtime API dependencies:
- Download the ArcGIS Runtime SDK for Java as a .zip or .tgz.
- Extract the archive contents and copy the libs, jniLibs, and resources folders into the root of your project directory.
- Add all of the jars in the libs folder to your classpath.
For the OpenJFX dependencies:
- Download the OpenJFX SDK (11.0.2) from Gluon.
- Extract the archive contents and copy the directory into the root of your project directory.
- Add the JavaFX jars to your module path. ArcGIS Runtime requires the
javafx.controls
,javafx.fxml
,javafx.web
, andjavafx.media
modules. Refer to Gluon's documentation for setup instructions.
Configure the native libraries
For your app to run, the API must be able to find the required libraries. You have a few options, ordered here by priority:
- The absolute path to the downloaded API specified programmatically at the start of your app's code:
- The current working directory according to Java's
user.dir
system property. This is usually the project's root directory when run from an IDE, or the directory from which you run your app's jar. - The location you specify by the environment variable
ARCGISRUNTIMESDKJAVA_100_10_0
.
If the native libraries are not properly configured, you will see an exception similar to the following:
Additional downloads
You can do many things with this API, here are a few to consider:
Sample code
Review sample code in our complete sample directory, or download the code from our GitHub repository. Interact with live samples using the sample viewer app.
ArcGIS Runtime API for Java Toolkit
The ArcGIS Runtime SDK for Java Toolkit contains controls and utilities to simplify your app development. For example:
- Compass: A control that shows orientation when a map is rotated.
- OverviewMap: An overview map control that indicates the viewpoint of another map or scene view.
- Scalebar: Scalebar control that shows an accurate distance that can be used to visually gauge distances on a map view.
StreetMap Premium
To use StreetMap Premium (the StreetMap Premium extension), download the demonstration data from the downloads page for development and testing. Please contact Esri Customer Service for access to the region of your choice for development and testing or to license StreetMap Premium data for deployment.
Supplemental data
To use grid-based transformations, download supporting Projection Engine files from the downloads page.
To work with Electronic Navigational Charts (ENC), download the hydrography directory from the downloads page.
Local Server
To run offline geoprocessing tasks in your app, install Local Server.