- Installation
- Memory
- Upgrading
- Sharing the Java Runtime
- Compiling Plugins
- Browser Support
- Command Line Options
- Creating a Gnome Launcher
Installation
To install and run ImageJ, download the Linux x86 .tar.gz file, extract the ImageJ directory, change to the ImageJ directory, and execute the 'run' script.Here is an example:
On newer versions of Linux you can run ImageJ by double clicking on on the 'run' script.gunzip ij123-x86.tar.gz tar xvf ij123-x86.tar cd ImageJ ./runThis installation includes Sun's Java Runtime Environment 1.5 (in the jre directory) and the complete ImageJ source code (in src.zip).
Memory
To make more than 256MB of memory available to ImageJ, edit the 'run' script. For example, changing the script tomakes 512MB available to ImageJ. The ImageJ Documentation Wiki FAQs have instructions on how to make up to 8GB available to ImageJ on a 64-bit computer running a 64-bit version of Linux and a 64-bit version of Java../jre/bin/java -Xmx512m -jar ij.jarUpgrading
To upgrade to the latest version of ImageJ, replace the ij.jar JAR file in the ImageJ directory with a newer one from http://rsb.info.nih.gov/ij/upgrade/.Sharing the Java Runtime
You can specify the location of the plugins directory from the command line using the -ijpath option. This allows ImageJ to be in a common location (e.g., /usr/local/ImageJ) and run from the users home directory using a shell script. This example runs ImageJ from /usr/local/ImageJ using a plugins directory at /home/wayne/ImageJ/plugins:This example uses Java 1.5 SDK to run ImageJ from /usr/local/ImageJ with the plugin directory also located in /usr/local/ImageJ:cd /usr/local/ImageJ ./jre/bin/java -Xmx512m -jar ij.jar -ijpath /home/wayne/ImageJIt adds tools.jar to the classpath, which is required for the Plugins>Compile and Run command to work./usr/java/jdk1.5/bin/java -Xmx512m -cp /usr/local/ImageJ/ij.jar:/usr/java/jdk1.5/lib/tools.jar -ijpath /usr/local/ImageJCompiling Plugins
The Plugins/Compile and Run command uses the javac compiler contained in the tools.jar file included with the Java Development Kit (JDK). The Java runtime included with the Linux distribution of ImageJ includes tools.jar in ImageJ/jre/lib/ext. Users who install the JDK separately must add tools.jar to the command line. Here is an example:java -Xmx200m -cp ij.jar:\usr\local\jdk1.5\lib\tools.jar ij.ImageJBrowser Support
Most commands in the Help menu run the Netscape browser to open pages on the ImageJ website. If Netscape is not installed, you will need to brovide a symbolic link such asWith ImageJ 1.38k and later, Help menu commands expect one of the following browsers to be installed (tested in this order): netscape, firefox, konqueror, mozilla, opera, epiphany or lynx. If you prefer a particular browser, make a symbolic link to 'netscape', as outlined above.ln -s /usr/local/bin/mozilla /usr/local/bin/netscapeCommand Line Options
ImageJ recognizes the following command line options:"file-name" Opens a file Example 1: blobs.tif Example 2: /Users/wayne/images/blobs.tif Example3: e81*.tif -ijpath path Specifies the path to the directory containing the plugins directory Example: -ijpath /Applications/ImageJ -portSpecifies the port ImageJ uses to determine if another instance is running Example 1: -port1 (use default port address + 1) Example 2: -port2 (use default port address + 2) Example 3: -port0 (do not check for another instance) -macro path [arg] Runs a macro, passing it an optional argument Example 1: -macro analyze.ijm Example 2: -macro analyze /Users/wayne/images/stack1 -batch path [arg] Runs a macro in batch (no GUI) mode, passing it an optional argument. ImageJ exits when the macro finishes. -eval "macro code" Evaluates macro code Example 1: -eval "print('Hello, world');" Example 2: -eval "return getVersion();" -run command Runs an ImageJ menu command Example: -run "About ImageJ..." Creating a Gnome (Ubuntu) Launcher
Edit the file named 'run' in the ImageJ directory, changing it to eitherif using the Java bundled with the ImageJ distribution or to~/ImageJ/jre/bin/java -Xmx512m -jar ~/ImageJ/ij.jar -ijpath ~/ImageJif using the Java installed on your system. Note, these examples assume that the ImageJ directory is in your home directory.java -Xmx512m -jar ~/ImageJ/ij.jar -ijpath ~/ImageJNext make sure the file executable:
Then follow these steps:$ cd ~/ImageJ/ $ chmod +x runAlternatively, the System>Preferences>Menus & Toolbars command will let you add a menu entry in the Gnome menus.
- If it is not already in the ImageJ directory, download the icon at rsb.info.nih.gov/ij/images/ImageJ.png.
- Copy it to /usr/share/pixmaps.
- In the Gnome panel, at the top of the screen, right click and choose "Add to panel...".
- Select "Custom Application Launcher".
- Push the "Browse" button, find the 'run' script and select it.
- Click on the "No Icon" button and select the ImageJ icon (an antique brass microscope).