ArtiSynth Installation Guide for MacOS

4 Installing Java

ArtiSynth requires that you have a full 64-bit Java development kit (JDK) installed. A JDK comes with a Java compiler, whereas the simpler Java run time environment (JRE) does not. Note, however, that a JDK usually includes a JRE.

Important: on ARM-based machines, you must still install a 64-bit Intel-based JDK which must then execute through an Intel compatibility layer. Invocation of the compatibility layer should generally be invisible to the user. 64-bit Intel-based JDKs contain the string x64 in their download names, whereas ARM-based JDKs contain aarch64 or arm32.

By default, ArtiSynth is compiled to be compliant with Java 8. While ArtiSynth will work under later Java versions, Java 8 provides compatibility with MATLAB (which still uses Java 8), as well as the Jython console. Therefore we currently recommend using Java 8; this also provides maximum compatibility with MATLAB and Jython, as indicated above. We specifically recommend the Java SE Development Kit 8uXXX (where XXX is the latest revision number), which can be obtained from Oracle (registration required). At the time of this writing, the download page is located at

and the latest release is 8u281. This page provides downloads for all systems; be sure to choose the download link appropriate to yours. For MacOS, this will be jdk-8u281-macosx-x64.dmg.

If the above Oracle link is no longer current, the search terms ``java 8 jdk download'' should get you to the right place.

4.1 Ensuring the JDK is visible to your system

After the JDK has been installed, it is important to ensure that it is visible to your system and that it supersedes any other Java installations. One test for this is to 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 you can set the “default” JDK by setting the JAVA_HOME environment variable. This can be done inside the initialization file for whichever command line shell you are using.

Assume that the desired JDK has version number 1.8.0_281 and that your home directory is <HOMEDIR>. Then for the bash shell, one can use a plain text editor to edit <HOMEDIR>/.bashrc (or create the file if it does not already exist) and insert a line of the form

export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_281`

where the left quote character ` is used instead of the more common right quote . For the csh or tcsh shells, one can edit <HOMEDIR>/.cshrc and insert a line of the form

setenv JAVA_HOME `/usr/libexec/java_home -v 1.8.0_281`

Setting JAVA_HOME can also be done directly within the shell; doing it within the initialization file simply avoids the need to do so each time a new terminal window is opened.

If you are using an integrated development environment (IDE), such as Eclipse (Section 13), for compiling and running ArtiSynth programs, you should also ensure that this IDE is configured to use the installed JDK. Instructions on how to do this for Eclipse are given in Section 13.1.1.