Skip To Content ArcGIS for Developers Sign In Dashboard

Get the SDK

Start here to set up your development environment with ArcGIS Runtime SDK for Java.

Get the SDK and dependencies

Before reading further, make sure your development machine meets the system requirements.

An ArcGIS Runtime SDK for Java app requires the following dependencies:

  • The arcgis-java jar
  • ArcGIS Runtime jniLibs and resources native libraries
  • OpenJFX 11 modules

There are three ways to get set up with the SDK: Gradle, Maven, or the downloaded .zip file. Choose the one you are most familiar with.

Note:

If you are working in a restricted development environment, where you may not have online access or you do not have permission to write files to the user directory, choose the .zip option.

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.

plugins {
    id 'application'
    id 'org.openjfx.javafxplugin' version '0.0.8'
}

ext {
    arcgisVersion = '100.6.0'
}

repositories {
    jcenter()
    maven {
        url 'https://esri.bintray.com/arcgis'
    }
}

configurations {
    natives
}

dependencies {
    compile "com.esri.arcgisruntime:arcgis-java:$arcgisVersion"
    natives "com.esri.arcgisruntime:arcgis-java-jnilibs:$arcgisVersion"
    natives "com.esri.arcgisruntime:arcgis-java-resources:$arcgisVersion"
}

javafx {
    version = "11.0.1"
    modules = [ 'javafx.controls', 'javafx.web', 'javafx.fxml', 'javafx.media' ]
}

task copyNatives(type: Copy) {
    description = "Copies the arcgis native libraries into the .arcgis directory for development."
    group = "build"
    configurations.natives.asFileTree.each {
        from(zipTree(it))
    }
    into "${System.properties.getProperty("user.home")}/.arcgis/$arcgisVersion"
}

run {
    dependsOn copyNatives
    mainClassName = 'com.mycompany.app.App'
}

wrapper {
    gradleVersion = '5.0'
}

Run the Gradle copyNatives task. This will unpack the native libraries into $USER_HOME/.arcgis. The API will automatically look in this directory to find the native libraries.

Note:

It may take a minute to download the native libraries depending on bandwidth, but this will only happen once since the libraries will be cached.

Maven

The pom file below shows how to get these 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.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.mycompany</groupId>
    <artifactId>app</artifactId>
    <packaging>jar</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>My Map App</name>
    <url>http://maven.apache.org</url>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <arcgis.version>100.6.0</arcgis.version>
    </properties>
    <repositories>
        <repository>
            <id>arcgis</id>
            <url>https://esri.bintray.com/arcgis</url>
        </repository>
    </repositories>
    <dependencies>
        <!--JavaFX dependencies -->
        <dependency>
          <groupId>org.openjfx</groupId>
          <artifactId>javafx-controls</artifactId>
          <version>11</version>
        </dependency>
        <dependency>
          <groupId>org.openjfx</groupId>
          <artifactId>javafx-web</artifactId>
          <version>11</version>
        </dependency>
        <dependency>
          <groupId>org.openjfx</groupId>
          <artifactId>javafx-fxml</artifactId>
          <version>11</version>
        </dependency>
        <dependency>
          <groupId>org.openjfx</groupId>
          <artifactId>javafx-media</artifactId>
          <version>11</version>
        </dependency>
        <!--ArcGIS dependencies -->
        <dependency>
            <groupId>com.esri.arcgisruntime</groupId>
            <artifactId>arcgis-java</artifactId>
            <version>${arcgis.version}</version>
        </dependency>
        <dependency>
            <groupId>com.esri.arcgisruntime</groupId>
            <artifactId>arcgis-java-jnilibs</artifactId>
            <version>${arcgis.version}</version>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>com.esri.arcgisruntime</groupId>
            <artifactId>arcgis-java-resources</artifactId>
            <version>${arcgis.version}</version>
            <type>zip</type>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.1.1</version>
                <configuration>
                    <artifactItems>
                        <artifactItem>
                            <groupId>com.esri.arcgisruntime</groupId>
                            <artifactId>arcgis-java-jnilibs</artifactId>
                            <version>${arcgis.version}</version>
                            <type>zip</type>
                            <overWrite>false</overWrite>
                            <outputDirectory>${user.home}/.arcgis/${arcgis.version}</outputDirectory>
                        </artifactItem>
                        <artifactItem>
                            <groupId>com.esri.arcgisruntime</groupId>
                            <artifactId>arcgis-java-resources</artifactId>
                            <version>${arcgis.version}</version>
                            <type>zip</type>
                            <overWrite>false</overWrite>
                            <outputDirectory>${user.home}/.arcgis/${arcgis.version}</outputDirectory>
                        </artifactItem>
                    </artifactItems>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <release>11</release>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.6.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>java</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <mainClass>com.mycompany.app.App</mainClass>
                </configuration>
            </plugin>
            <plugin>
                <groupId>io.takari</groupId>
                <artifactId>maven</artifactId>
                <version>0.7.4</version>
            </plugin>
        </plugins>
    </build>
</project>

Run the Maven dependency:unpack goal. This will unpack the native libraries into $USER_HOME/.arcgis. The API will automatically look in this directory to find the native libraries.

Note:

It may take a minute to download the native libraries depending on bandwidth, but this will only happen once since the libraries will be cached.

Zip

If you don't want to use a build tool like Gradle or Maven, you can download and set up the dependencies manually. See below for instructions.

For a starter project using the SDK .zip file with instructions for Eclipse and IntelliJ, download or clone the java-zip-starter-project on GitHub.

For the ArcGIS Runtime SDK dependencies:

  1. Download the ArcGIS Runtime SDK as a .zip or .tgz from the Downloads page.
  2. Extract the archive contents and copy the libs, jniLibs, and resources folders into the root of your project directory.
  3. Add all of the jars in the libs folder to your classpath.

For the OpenJFX dependencies:

  1. Download the OpenJFX SDK (11.0.1) from Gluon.
  2. Extract the archive contents and copy the directory inside into the root of your project directory.
  3. Add the JavaFX jars to your module path. ArcGIS Runtime requires the javafx.controls, javafx.fxml, javafx.web, and javafx.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 SDK's native libraries.

With Gradle and Maven

If you used Gradle or Maven as described above, the native libraries will be downloaded to your user directory in the .arcgis folder. The API can automatically find the native libraries at this location, so no further configuration is necessary.

With the downloaded zip

If you downloaded the .zip file, you have a few options, ordered here by priority:

  1. The absolute path to the downloaded SDK specified programmatically at the start of your app's code:
    ArcGISRuntimeEnvironment.setInstallDirectory("C:/path/to/arcgis-runtime-sdk-java-100.6.0")
  2. 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.
  3. The location you specify by the environment variable ARCGISRUNTIMESDKJAVA_100_6_0.

Note:

You should not use any of the .zip configurations if you are using the Gradle or Maven workflows.

If the native libraries are not properly configured, you will see an exception similar to:

Caused by: java.lang.RuntimeException: Could not find runtime in any of:
- A directory specified by calling ArcGISRuntimeEnvironment.setInstallDirectory()
- The current directory C:\Users\johndoe\my-project-directory
- A location specified by the environment variable ARCGISRUNTIMESDKJAVA_100_6_0
- Within the ".arcgis" directory in the user's home path C:\Users\johndoe\.arcgis

Learn More

You're now ready to create mapping apps. For developers new to the ArcGIS Runtime and the ArcGIS Platform, it is recommended to start by reading the "Fundamentals" section of this guide. Then take a look at the following resources:

  1. Tutorials: Learn by doing; a series of coding labs that build on each other
  2. Samples: Over one hundred bite-sized applications showing off every feature of the API
  3. API Reference:All public classes and methods in the API

Related topics