Last updated: September, 2022
This describes how to quickly install one of the precompiled versions of ArtiSynth, which can be useful for users wanting to test the system and run the demonstration programs. More complete instructions, including how to obtain the latest development version from Github, compile and run using the Eclipse IDE, and install external model packages, are provided in the general installation guides for Windows, MacOS, and Linux.
You need a 64 bit Windows, MacOS, or Linux system based on an Intel processor. You can also use systems based on the ARM processor if they implement an Intel compatibility layer. MacOS systems based on the new Apple ARM processor (the M1 or M2 chips) implement a compatibility layer (called Rosetta) that appears to allow ArtiSynth to run as is, provided that you install a 64-bit Intel-based Java development kit (JDK).
A 64-bit Java development kit (JDK) should be installed. This
should be an Intel-based JDK (containing x64 in its download
name); on ARM-based machines, this should run using the Intel
compatibility layer. ArtiSynth will work with the most recent Java
versions, but we recommend using the older Java 8 since that will also
provide compatibility with MATLAB and the Jython console. You need a
full Java Development Kit (JDK), not simply a runtime environment
(JRE). We recommend the Java SE Development Kit 8uXXX (XXX
being the latest update) which can be obtained from Oracle
To verify that the Java JDK is visible to your system, open a terminal window (e.g., CMD on Windows), run the command javac -version, and check that the version matches the JDK. If it does not, follow the instructions in Section 2.
Download the latest precompiled ArtiSynth release (e.g., artisynth_core_3.6.zip) from www.artisynth.org/downloads.
Unzip the file into a folder, preferably one without spaces in the name.
On Windows: click bin\artisynth.bat under the install folder.
On MacOS or Linux: use a terminal to run bin/artisynth under the install folder.
To run demos, open the Models menu at the top and choose the model you would like. It will be loaded and displayed in the viewer. To start/stop simulation, use the play button at the top right.
If <AT> denotes the top-level folder of your ArtiSynth installation, then add <AT>\bin (Windows) or <AT>/bin (MacOS and Linux) to your system Path as described in Section 3.
Edit the .java file for the demo, which will be located in a folder under <AT>\src\artisynth\demos, using a plain text editor (e.g., notepad on Windows).
From within a terminal window (e.g., CMD on Windows), go to the demo folder and enter the command compile.
It is important to ensure that the JDK is visible to your system and supersedes any other Java installations.
If <JDK> denotes the top-level folder of your installed JDK, then add the folder <JDK>\bin (Windows) or <JDK>/bin (Linux) to your system Path, using the instructions given in Section 3. The folder should be added ahead of any other Java installations that might be specified on the Path.
On Windows, <JDK_DIR> is likely to be located under C:\Program Files\Java.
On Mac OS X, 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 folder 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.
The system “Path” is a list of directories which the system searches in order to find executables. Adding a directory to the path allows executables contained in that directory to be called directly from a command window (such as CMD on Windows).
Open the Start search, enter “env”, and choose “Edit the system environment variables”.
Click on Environment Variables.
Under User variables (the top window), click on Path and click Edit. If Path does not exist, click New.
In the Edit environment variable dialog, click New and enter the full path name for each directory you wish to add.
Close all dialogs by clicking OK and restart your command window.
Right-click My Computer, and then click Properties.
Click the Advanced tab.
Click Environment variables.
In the top User variables window, click on Path and then Edit. If Path does not exist, click New.
In the edit window, add the full path name for each new directory, separated by semi-colons ’;’.
Close all dialogs by clicking OK and restart your command window.
For example, if ArtiSynth is installed at C:\artisynth\artisynth_core and the desired JDK is at C:\Program Files\Java\jdk1.8.0_281, then we can add the bin directories for both by setting the User path to
Since Mac OS X is a Unix-based system, directories can be added to the path by editing the PATH environment variable directly in the initialization files for whichever command line shell you are using, as described in Section 3.
On Mac OS X 10.8 and greater, directories can also be added to the path by adding a text file containing the directories to /etc/paths.d. In particular, we can create a file called ArtiSynth in /etc/paths.d that contains the full path names of the desired directories.
Open a terminal window
Use sudo to create /etc/paths.d/ArtiSynth with a plain text editor. For example:
sudo nano /etc/paths.d/ArtiSynth
Add the full path name of each desired directory, one per line, and save the file.
To test the revised PATH, open a new terminal window and enter the command: echo $PATH.
On Linux, directories can be added to the path by appending them to the PATH environment variable, which is a list of directories separated by colons ‘:’. The most direct way to do this is to redefine PATH inside one of the initialization files for whichever command line shell you are using.
Assume that your home folder is <HOMEDIR>. Then for the bash shell, one can edit <HOMEDIR>/.bashrc (or create the file if it does not already exist) and insert a line of the form
while for the csh out tcsh shells, one can edit <HOMEDIR>/.cshrc and insert a line of the form
setenv PATH <DIR>":"$PATH