Welcome to the ArcGIS Maps SDK for Java Samples repository.
The ArcGIS Maps SDK for Java is used to build mapping, location, and GIS applications for desktop applications running on Windows, Mac, or Linux. This repo contains a set of sample projects demonstrating how to accomplish various mapping and geospatial tasks with the ArcGIS Maps SDK for Java.
- Sample Viewer
- Running the samples locally via this project
- Setup an API Key
- Offline sample data
- System requirements for ArcGIS Maps SDK for Java
- Issues
- Contributing
You can browse our samples by downloading our Sample Viewer Application.
Each sample is an individual Gradle project that can be run standalone. Installing Gradle is not necessary since each sample includes the Gradle wrapper.
- System Requirements for ArcGIS Maps SDK for Java
- An API Key. More details
- IntelliJ IDEA
- Fork and clone this repo. More details.
- Open IntelliJ IDEA and select File > Open....
- Choose one of the sample project directories (e.g.
display-map
) and click OK. - Select File > Project Structure... and ensure that the Project SDK and language level are set to use Java 17.
- Store your API key in the
gradle.properties
file located in the/.gradle
folder within your home directory. The API key will be set as a Java system property when the sample is run.
Note: if a gradle.properties
file does not already exist in the /.gradle
folder within your home directory, a Gradle task in the samples build.gradle
file will generate one for you to populate with your API key.
apiKey = yourApiKey
- Open the Gradle view with View > Tool Windows > Gradle.
- In the Gradle view, double-click the
run
task under Tasks > application to run the app.
Note: if you encounter the error Could not get unknown property 'apiKey' for task ':run' of type org.gradle.api.tasks.JavaExec.
you may have to set the Gradle user home in the IntelliJ Gradle settings to the /.gradle
folder in your home directory.
cd
into one of the sample project directories (e.g.display-map
).- Run
gradle wrapper
to create the Gradle Wrapper - Store your API key in the
gradle.properties
file located in the/.gradle
folder within your home directory. The API key will be set as a Java system property when the sample is run. - Run
./gradlew run
on Linux/Mac orgradlew.bat run
on Windows to run the app.
Accessing Esri location services, including basemaps, routing, and geocoding, requires authentication using either an ArcGIS identity or an API Key:
- ArcGIS identity: An ArcGIS named user account that is a member of an organization in ArcGIS Online or ArcGIS Enterprise.
- API key: A permanent key that gives your application access to Esri location services. Visit your ArcGIS Developers Dashboard to create a new API key or access an existing API key.
Some samples require offline data. A samples-data
directory will automatically download to the project root when the Gradle project is configured/imported.
See the ArcGIS Maps SDK for Java's system requirements.
Find a bug or want to request a new feature? Please let us know by submitting an issue.
Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.
New to Git? Check out our Working with Git guide.
Copyright 2023 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.