ArcGIS Runtime Java SDK Samples
This project includes a set of samples demonstrating how to accomplish various mapping and GIS tasks with the ArcGIS Runtime SDK for Java.
These samples are built with Gradle. If you want to learn more about Gradle, learn more from Gradle's guide.
This guide has instructions for running samples using the command line or with Eclipse and IntelliJ IDEA.
For developers new to Git, please see the wiki page for how to clone this repository.
Running the Samples
To run the samples in a terminal,
cd into the project and call the gradle
run task, supplying the sample main class:
$ ./gradlew run -PmainClass="com.esri.samples.scene.display_scene.DisplaySceneSample"
> gradlew.bat run -PmainClass="com.esri.samples.scene.display_scene.DisplaySceneSample"
mainClass property is supplied, the default sample (set in the build.gradle file) will be run.
There is no need to install Gradle to run the samples.
The ArcGIS Runtime Gradle Plugin
The plugin provides the project with everything an ArcGIS runtime project needs to run. It adds the
arcgis api as a dependency and downloads the native libraries into
$USER_HOME/.arcgis. This download occurs
automatically the first time you build the project and is only performed once.
Offline sample data
Some samples require offline data. A
samples-data directory will automatically download to the project root the
first time you call the
Importing into an IDE
We will step through how to import the Samples project into Eclipse and IntelliJ IDEA. Other IDEs may support Gradle too. Please consult their documentation for importing Gradle projects.
After cloning the samples, open IntelliJ IDEA and follow these steps:
- Click Import Projects from the Welcome Screen or select File > New > Project from Existing Sources.
- In the select path dialog, select the
build.gradlefile in the
arcgis-runtime-samples-javadirectory. Click OK after specifying the
- Click OK at the next dialog to complete the import.
To view all of the gradle tasks including the Run task, go to View > Tool Windows > Gradle.
Alternatively, you can open the sample's main class, right-click, and select Run from the dropdown menu.
To import the samples with Eclipse's default gradle plugin, follow these steps:
- Open Eclipse and select File > Import.
- In the import wizard, choose Gradle > Gradle Project, then click Next.
- Select the
arcgis-runtime-samples-javadirectory as the project root directory.
- Click finish to complete the import.
Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.
Find a bug or want a new feature? Please let us know by submitting an issue.
Copyright 2016 Esri
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
A copy of the license is available in the repository's license.txt file.