To install ImageJ, download the Mac OS X .tar.gz file and double-click on it to extract the "ImageJ (OS X)" folder. To run ImageJ, open this folder and double-click on the ImageJ icon.
Memory
To make more than 192MB of memory available to ImageJ, control-click on the ImageJ application,
select "Show Package Contents", open the "Contents" folder, double-click on "Info.plist", and edit the
value of the Root>Java>VMOptions property. You will need to double-click on the value
of this property (e.g., "-Xms32m -Xmx192m") before you can edit it.
In ImageJ 1.30 and earlier, use a text editor such as TextEdit to edit the line com.apple.mrj.application.vm.options=-Xmx128M in ImageJ/Contents/Resources/MRJApp.properties. Another way to make more memory available to ImageJ is by running from the command line and using the -Xmx option. The maximum amount of memory that can be allocated is about 1.7 GB.
Upgrading
To upgrade to the latest version of ImageJ, replace the ij.jar file in the ImageJ application with a newer one from http://rsb.info.nih.gov/ij/upgrade/. To do this, control-click on the ImageJ application, select "Show Package Contents", and then drag the newer ij.jar into the Contents/Resources/Java folder.
Drag and Drop
The OS X version of ImageJ opens images, text files, ROIs and LUTs that are dropped on the ImageJ icon.
Known Problems
Switching Beween Java 1.4.1 and Java 1.31
It is possible to revert to Java 1.3.1 when running Java programs from the command line
or by double clicking on a jar file by typing these two commands into a Terminal window:
Here is a simple AppleScript that sends commands to Terminal to have it automatically launch ImageJ:
Adding a JAR File
Some plugins require adding a JAR file to ImageJ. In ImageJ 1.31 or later, this is done by copying
the JAR file into the plugins folder or an immediate subfolder of the plugins folder, then restarting
ImageJ. To compile a plugin that uses a JAR file, copy the JAR file to /Library/Java/Extensions.
The ImageJ double-clickable application uses Java 1.4.1 or later. To use Java 1.3.1,
control-click on the ImageJ application,
select "Show Package Contents", open the "Contents" folder, double-click on "Info.plist", and change the
value of the Root>Java>JVMVersion property from "1.4+" to "1.3.1". You will need to double-click
on the field containing "1.4+" before you can edit it.
cd /System/Library/Frameworks/JavaVM.framework/Versions
This switches the symbolic link for the current JDK to 1.3.1.
You can view what the CurrenJDK is pointing to by running (in the same directory):
sudo ln -sfh 1.3.1 CurrentJDK
ls -al
Running from the Command Line
To run ImageJ from the command line, open a Terminal window, cd to the ImageJ directory, then use
the java command to run ImageJ. The easiest way to do this is to drag the ImageJ folder to the Terminal Window,
type return, then type:
Or if ij.jar is in the current directory, type:
java -jar -mx256m ImageJ.app/Contents/Resources/Java/ij.jar
(or java -mx256m -cp ImageJ.app/Contents/Resources/Java/ij.jar ij.ImageJ)
The -Xmx256m switch specifies that ImageJ will have available a maximum of 256MB of RAM.
java -jar -Xmx256m ij.jar
(or java -Xmx256m -cp ij.jar ij.ImageJ)
With OS X 10.1 or later, you can also run ImageJ by double-clicking on ij.jar.
tell application "Terminal"
run
do script with command "cd /Applications/ImageJ
java -jar -mx350m ./ImageJ.app/Contents/Resources/Java/IJ.jar"
end tell