This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Documentation / Mathematica / Add-ons & Links / J/Link / Installation /

Mac OS X

Step 1: Move the JLink directory to the AddOns/Applications directory (Mathematica 4.0 and 4.1 Only)

Move the entire JLink directory to the following location, where <home directory> is your home directory (typically something like /Users/myusername):

<home directory>/Library/Mathematica/4.1/AddOns/Applications

Launch Mathematica and select Rebuild Help Index from the Help menu. This will cause the J/Link User Guide to show up in the Help Browser when you click the Add-ons button.

Step 2 (Optional): Add JLink.jar to your CLASSPATH

If you are going to be writing Java programs that use J/Link (as opposed to only Mathematica programs), and you will be using the java or javac command-line tools, you will probably find it convenient to set up the CLASSPATH environment variable to point to JLink.jar. If you do not set up the CLASSPATH environment variable, then you will have to use the -classpath option every time you compile or run from the command line. Some development tools, notably Borland's JBuilder, do not use the CLASSPATH environment variable to locate classes. You will need to consult the tool's documentation for information.

To set the CLASSPATH, add a line like the following to the .cshrc file in your home directory:

(For Mathematica 4.2 and later)

setenv CLASSPATH .:"/Applications/Mathematica 5.0.app/AddOns/JLink/JLink.jar":$CLASSPATH



(For Mathematica 4.0 and 4.1)

setenv CLASSPATH .:~/Library/Mathematica/4.1/AddOns/Applications/JLink/JLink.jar:$CLASSPATH