This project includes a set of samples demonstrating how to accomplish various mapping and GIS tasks with the ArcGIS Runtime SDK for Java.
Be sure to also check out our toolkit on GitHub.
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.
To run the samples in a terminal, cd
into the project and call the gradle run
task, supplying the sample main class:
On Linux/Mac
$ ./gradlew run -PmainClass="com.esri.samples.scene.display_scene.DisplaySceneSample"
On Windows
> gradlew.bat run -PmainClass="com.esri.samples.scene.display_scene.DisplaySceneSample"
If no 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.
Java 11 users may find exceptions when running the project if their library path is still set for Oracle JDK 1.8 (see the OpenJavaFX docs for more information). A workaround for this is to add the following argument in the run
task of the Gradle buildscript:
systemProperty "java.library.path", "C:\tmp"
Some samples require offline data. A samples-data
directory will automatically download to the project root the
first time you call the run
task.
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.gradle
file in thearcgis-runtime-samples-java
directory. Click OK after specifying thebuild.gradle
file. - 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-java
directory 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 2018 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
http://www.apache.org/licenses/LICENSE-2.0
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.