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
- Start Eclipse.
- From the Eclipse menus choose File > New > Project.
- Expand the 'ArcGIS Runtime for Java' folder.
- Select the 'ArcGIS Runtime Java Map Application'. Click Next.
- Add a 'Project name' and 'Location', if necessary. Click Next.
- Click Next.
- Add a Java Class Name. Click Finish.
- A new Java Project is created containing the ArcGIS Runtime Java Dependent jars used by the API.
Running the application
- Right-click the .java class (for example NewClass.java) in the Package Explorer and select Run As > Java Application.
- A map application will be created similar to the image below.
- 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."
- 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
"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!"
- inserting the following line of code before the map is constructed:
2/7/2013