Install Java and Maven
This topic describes the prerequisites for developing extensions with ArcGIS Enterprise SDK in Java. You must complete the following steps:
- Download JDK and Maven
- Download and install a compatible Java development kit (JDK).
- Download and install a Maven binary archive.
- Set environment variables
- Add the installed JDK to the
- Add the Maven installation path to the
- Add the
- Add the installed JDK to the
ENTDEVKITJAVA environment variable is automatically added during the Enterprise SDK installation on a Windows environment. On a Linux environment, you must set it manually (see set environment variables).
To develop extensions with ArcGIS Enterprise SDK in Java, you must have a compatible JDK as a stand-alone installation, or as part of an integrated development environment (IDE). If the environment is not set correctly, the Java proxies will be unable to access core ArcGIS Enterprise SDK objects through the Java Native Interface (JNI).
You can download and install Oracle JDK, AdoptOpenJDK, or another JDK from your designated vendor based on your organization's requirement. Be sure the version of the JDK meets the ArcGIS Enterprise SDK system requirements. For ArcGIS Enterprise SDK 10.8.1 or 10.9, the supported JDK version is 11.0.6 or later versions of JDK 11. Building extensions with Java 12 or higher is not supported.
As ArcGIS Enterprise SDK uses the Maven framework to manage the Java SOE and SOI projects, you must download and install Maven. Maven binary archives can be downloaded here. Be sure the version of Maven meets the SDK's system requirements. For ArcGIS Enterprise SDK 10.8.1 or 10.9, the supported Maven version is 3.6.1 or later. For Linux machines, choose the binary tar.gz archive link. For Windows machine, choose the binary zip archive file. After the Maven archive is downloaded, extract the file to your machine. To learn more about Maven, visit Apache Maven.
After installing JDK and Maven, you must set the environment variable with your installed JDK and Maven. At the same time, ensure the SDK's environment variable
ENTDEVKITJAVA is also set correctly. You can use the
export Bash command to set these environment variables together as follows:
Type the following command in the terminal to open the SDK user's user profile.
[ags@linuxmachine ~]$ nano ~/.bash_profile
The above command opens the user profile of the SDK user
nanotext editor. You can also choose other text editors based on your preference, such as
gedit, and so on.
Add environment variables for the SDK user.
ENTDEVKITJAVAenvironment variables. Add the
JAVA_HOMEand Maven installation path to the
export JAVA_HOME=/home/ags/opt/jdk-11.0.6+10 export ENTDEVKITJAVA=/home/ags/arcgis/enterprisesdk PATH=$JAVA_HOME/bin:/home/ags/sdk/apache-maven-3.6.3/bin:$PATH:$HOME/.local/bin:$HOME/bin export PATH
JAVA_HOMEshould be the JDK path.
ENTDEVKITJAVAshould be the ArcGIS Enterprise SDK installation path. By default, it's
Press Ctrl + X, press Y, and press Enter to save the edits.
sourcecommand to apply the above changes to
[ags@linuxmachine ~]$ source ~/.bash_profile
java -versionin the terminal. It should show the version number of the installed JDK you set for
mvn -versionin the terminal. It should show the correct Maven version number along with the JDK version number. Type
echo $ENTDEVKITJAVAin the terminal. It should show the path of the ArcGIS Enterprise SDK installation.
On Windows, the
JAVA_HOME and Maven environment variables can be created from the System Properties dialog box.
To access the System Properties dialog box, click Start and click Control Panel.
In the Control Panel window, search for View advanced system settings and click the item. The System Properties dialog box appears. (This step may vary depending on your Windows operating system version).
On the System Properties dialog box, click Environment Variables. The Environment Variables dialog box appears.
On the Environment Variables dialog box, click New to create a new system variable if it's not set yet. Otherwise, click Edit to edit existing system variables.
PATHenvironment variables are set as follows:
ENTDEVKITJAVAis set to the Enterprise SDK installation path (by default,
JAVA_HOMEis the installed JDK path. Last, ensure you add locations of both the JDK bin folder and the Maven bin folder to
PATH. To check which version of Java and Maven should be used, refer to ArcGIS Enterprise SDK system requirements.
Click OK on the Environment Variables dialog box and click OK on the System Properties dialog box to apply the changes.
Open a command prompt or command shell and type
java -version. It should show the version number of your Java installation. Type
mvn -version. It should show the correct Maven version number along with the JDK version number. Type
echo %ENTDEVKITJAVA%in the terminal. It should show the path of the Enterprise SDK installation.
After you finish setting up the Java and Maven environment variables, you can continue to install the Maven artifacts.