ArcGIS Runtime SDK for Java

Develop your first map app with Maven

Use the steps below to create a basic mapping app using the Maven build tool. The steps use the Eclipse IDE, but other IDEs have Maven support too.

Make sure your development machine meets the System requirements 100.4.0.

Create a Maven project in Eclipse

  1. In Eclipse, click File > New > Project in the menu bar. In the New Project dialog, select the Maven folder and click Maven Project. Click Next.

    New Project wizard dialog with Maven Project selected
  2. In the next dialog, check the box that says Create a simple project (skip archetype selection). Click Next.
  3. In the last dialog, under Artifact, enter for the Group Id and app for the Artifact Id. Use the defaults for the remaining items. Click Finish.

    In the Package Explorer, your project should look as follows:

    Package Explorer with default maven project structure

Add SDK dependencies to your pom

  1. In the Package Explorer, double-click the pom.xml file. In the editor, select the pom.xml tab. It should look similar to the following:

    <project xmlns="" xmlns:xsi="" xsi:schemaLocation="">

  2. Update the pom to add the SDK dependencies.

    <project xmlns="" xmlns:xsi="" xsi:schemaLocation="">
            <!--ArcGIS Java Maven Plugin-->

  3. Save the file. Then, right-click the pom.xml file in the Package Explorer and select Run As > Maven build....
  4. In the Edit Configuration dialog, create a new configuration with name arcgis. In the Goals field, enter arcgis-java:arcgis. Click Run to run the goal.

    The ArcGIS Java SDK Plug-in for Maven will download the SDK's native libraries to the user's home directory.


    It may take a minute to download the native libraries depending on your network speed, but this will only happen the first time you use the SDK.

Develop a JavaFX map app

  1. Under the project's src/main/java source directory, create the package structure In the app package, create a new class called MyMapApp.

    Package Explorer showing class MyMapApp in package
  2. Double-click the class file in the Package Explorer and replace the code with the following JavaFX application:

    import javafx.application.Application;
    import javafx.scene.Scene;
    import javafx.scene.layout.StackPane;
    import javafx.stage.Stage;
    public class MyMapApp extends Application {
      public void start(Stage stage) throws Exception {
        // create stack pane and application scene
        StackPane stackPane = new StackPane();
        Scene scene = new Scene(stackPane);
        // set title, size, and add scene to stage
        stage.setTitle("Display Map Sample");
      public static void main(String[] args) {

  3. Right-click the code in the editor and choose Run As > Java Application. The app will open to show an imagery basemap with window titled "Display Map Sample".
  4. Following imports are for adding a basemap to a map and displaying that map to the map view.

    import com.esri.arcgisruntime.mapping.ArcGISMap;
    import com.esri.arcgisruntime.mapping.Basemap;
    import com.esri.arcgisruntime.mapping.view.MapView;

  5. After the class definition, a private variable for map view is added so it can be dispose of when application is finished.

    public class MyMapApp extends Application {
      private MapView mapView;

  6. In the start function, after the line the following tasks:
    1. Creates an ArcGISMap class, which defines the content of the map.
    2. Adds a basemap to the ArcGISMap class showing Imagery mapping.
    3. Creates a MapView JavaFX visual component that's linked to the Map class.
    4. Adds MapView to JavaFX application using the StackPane layout.

    // create a ArcGISMap with the a Basemap instance with an Imagery base layer
    ArcGISMap map = new ArcGISMap(Basemap.createImagery());
    // set the map to be displayed in this view
    mapView = new MapView();
    // add the map view to stack pane

  7. Overrides the stop method to dispose of application resources when the app closes.

     * Stops and releases all resources used in application.
    public void stop() {
      if (mapView != null) {

  8. Example of what the map should look like. You can use the mouse to zoom and pan the map.