You should use Java 21 or later. While ArtiSynth is currently compiled to be compatible with Java 8, this will be raised to Java 21 in the near future.
If you are using the Eclipse IDE (Section 13), the version of Java that comes with Eclipse (Java 21 or later for Eclipse 2024-09 and newer) meets this requirement and is used by default to compile and run ArtiSynth. You will then need to install a separate Java development kit (JDK) only if
you want to compile or run ArtiSynth from a terminal window, outside of Eclipse; or
you need a specific version of Java. In particular, if you plan to use ArtiSynth with MATLAB, ArtiSynth should be run with Java 21, which is compatible with recent versions of MATLAB (see Interfacing ArtiSynth to MATLAB), whereas newer versions of Eclipse come with later versions of Java.
If you are not using Eclipse, you will need a JDK. A JDK includes a Java compiler, whereas a simple Java runtime environment (JRE) does not.
Any JDK of version 21 or later will work. Free builds of the JDK are available from several sources; we suggest Eclipse Temurin, available from
JDKs are also available from Oracle at www.oracle.com/java/technologies/downloads but may be subject to certain licensing restrictions.
Select your operating system and architecture, the package type JDK, and the desired version (21, or later). For Linux, choose the architecture x64, and then unpack the .tar.gz archive into a location of your choice, such as /opt/java. This will create the JDK home directory, with a name like /opt/java/jdk-21.0.8+9. Many Linux distributions also provide JDKs as packages (e.g., openjdk-21-jdk on Ubuntu), which will install into locations such as /usr/lib/jvm/java-21-openjdk-amd64.
To compile or run ArtiSynth from a terminal window, the java and javac commands of your JDK must be visible there, and must supersede any other Java installations. To check this, open a terminal window and run the command
> javac -version
The output should match the version of the installed JDK. If it does not, or if the command javac is not found, then one fix is to add the directory <JDK_HOME>/bin to your system Path, as described in Section 14.1, where <JDK_HOME> is the JDK home directory described above. It should be added ahead of any other Java installations that might be specified. To see the current contents of the Path, open a terminal window and run the command
> echo $PATH