Creating a simple Java map application

This topic describes how to create a basic 2D map application using the project wizard in Eclipse. Before using this topic you must have installed the ArcGIS Runtime SDK for Java on your Windows or Linux machine and installed the Eclipse plugin.

How to create a map application using a project wizard

  1. Start Eclipse.
  2. From the Eclipse menus choose File > New > Project.
  3. Expand the 'ArcGIS Runtime for Java' folder.
  4. Select the 'ArcGIS Runtime Java Map Application'. Click Next.

  5. Add a 'Project name' and 'Location', if necessary. Click Next.

  6. Click Next.

  7. Add a Java Class Name. Click Finish.

  8. A new Java Project is created containing the ArcGIS Runtime Java Dependent jars used by the API.

Running the application

  1. Right-click the .java class (for example NewClass.java) in the Package Explorer and select Run As > Java Application.
  2. A map application will be created similar to the image below.

    Map application screenshot

  3. In Windows, by default the map application is rendered using DirectX; in Linux, the map is rendered using OpenGL. In Windows, if the map application is not created and the following Console message appears, ensure you have installed DirectX according to the system requirements.

    "DirectX Error: This may be caused by missing DirectX End-User Runtime installation."

  4. Alternatively, in Windows you can render your application using OpenGL by either:
    • inserting the following line of code before the map is constructed:

      ArcGISRuntime.setRenderEngine(RenderEngine.OpenGL)

    • or use the following argument to the JVM:

      -Dcom.esri.runtime.renderEngine=opengl

    If any of the following messages appear in the console then ensure you have installed OpenGL according to the system requirements.

    "OpenGL Error: This may be caused by the OpenGL drivers not being version 2.1 or higher. Note that remote desktop is not supported.""

    "OpenGL does not support the minimum version required!"

    "Required OpenGL extension is not available!"

2/7/2013