Windows Installation

Requirements

ImageJ requires Windows 95 or later. It runs on a machine with 64MB but it runs better with 256MB or more, particularly when working with large images and/or stacks.

Installation

The Windows version of ImageJ is available with or without Java. Both versions include ImageJ.exe, a Windows program contributed by George Silva that launches ImageJ (ij.jar). ImageJ.exe supports file-associations, drag and drop, auto-configuration and command line operation. If the jre folder (the Java runtime) is missing, ImageJ.exe detects the latest installed Java, generates the configuration file (ImageJ.cfg) and sets the memory limit to 2/3 of installed memory or 640MB, whichever is lower. Refer to the README for more information.

Memory

Use the Edit>Options>Memory command to make more than the default 128MB available to ImageJ. Note that setting the "Maximum Memory" value to more than about 75% of real RAM may result in poor perfomance due to virtual memory "thrashing". The Edit>Options>Memory command modifies the third line in the ImageJ.cfg file in the ImageJ folder, which must be writable. This is what ImageJ.cfg looks like with "Maximum Memory" set to 700MB:
    .
    jre\bin\javaw.exe 
    -Xmx700m -cp ij.jar ij.ImageJ
Note that this only works when you run ImageJ by double clicking on ImageJ.exe. No more than 64MB is available when you run ImageJ by double clicking on ij.jar.

The maximum amount of memory that can be allocated on a 32-bit Windows system running a Sun JVM (Java Virtual Machine) is ~1.5GB. Windows 64 with a 64-bit JVM does not have this limit, and BEA's JRockit JVM is reported to support up to ~3GB on 32-bit systems. More information is available on the ImageJ Documentation Wiki.

64-bit Windows

To use more than ~1.5GB of memory with a JVM from Sun requires a 64-bit CPU (AMD64, Intel Core 2 Duo, etc.), a 64-bit OS (Windows 2003 x64, Window XP x64 or Windows Vista x64), a 64-bit version of Java, and 3GB or more of RAM. To install 64-bit Java:
  1. Uninstall any existing versions of Java.
  2. Download and install the latest 64-bit Windows JDK from java.sun.com/javase/downloads/. As of December 2007, it is at the bottom of the Download page, under the heading Windows x64 Platform - Java(TM) SE Development Kit 6 Update 3, and the name of the file is jdk-6u3-windows-amd64.exe.
  3. Go to the ImageJ folder and delete any jre folder.
  4. Delete any ImageJ.cfg file.
  5. Restart ImageJ and the launcher (ImageJ.exe) will generate a new ImageJ.cfg that uses the 64-bit JDK you just installed. You may need to browse to C:\\Program Files\Java\jdk1.6.0_03\bin\javaw.exe if the launcher cannot find Java.
  6. Verify that ImageJ is running 64-bit Java by running the Plugins>Utilities>ImageJ Properties command. The "os.arch" property should have the value "amd64". With ImageJ 1.39m and later, the title of the Edit>Options>Memory and Threads dialog should be "Memory (64-bit)" .
  7. Use the Edit>Options>Memory and Threads command to make more than the default amount of memory available to ImageJ. If this is greater than 1.7GB, you will be warned that ImageJ may not function correctly. This warning only applies to the 32-bit version of Java.
The title of the Edit>Options>Memory & Threads dialog box changes to "Memory (64-bit)" when ImageJ is running on a 64-bit version of Java.

Upgrading

To upgrade to the latest version of ImageJ, replace the ij.jar file in the ImageJ folder with a newer one from http://rsb.info.nih.gov/ij/upgrade/.

Drag and Drop

The Windows version of ImageJ opens images, text files, ROIs and LUTs dropped on the "ImageJ" window. On Windows 2000/XP, it also opens files dropped on the ImageJ icon.

Appearance

On Windows XP, Activate Clear Type to improve the quality of text displayed in menus, dialog boxes, text windows, and in the status bar. To use a larger menu font, choose "Large Fonts" or "Extra Large Fonts" in the "Font Size:" drop down menu in the Appearance tab of the Display Properties control panel. Check "Antialiased Tool Icons" in ImageJ's Edit>Options>Misc dialog to improve the appearance of the tool icons.

Here is what ImageJ looks like with Clear Type enabled, "Extra Large Fonts" and antialiased tool icons.

     ImageJ window

Known Problems

  1. Java 1.4.2 crashes when running ImageJ. This bug has been reported to Sun and is fixed in Java 1.5 (aka Java 5.0).
  2. On 32-bit systems and a Sun JVM, ImageJ cannot use more than about 1.7GB of memory, regardless of how much RAM is installed.
  3. The text cursor is sometimes used instead of the cross hair. As a work around, check "Use Pointer Cursor" in Edit>Options>Misc or change the Windows XP cursor scheme in Control Panel/Mouse/Pointers to "(None)".
  4. JFileChooser, used by the getDirectory() macro function, does not work with Java 1.5 on Vista. To work around this problem, upgrade to Java 1.6

Compiling Plugins

The Plugins>Compile and Run command uses the javac compiler contained in the tools.jar file included with Sun's Java Development Kit (JDK). Compile and Run works with the version of ImageJ bundled with Java because it includes a copy of tools.jar in ImageJ/jre/lib/ext. It does not work if you use the version that is not bundled with Java and you have not installed the JDK. To fix this problem, uninstall the Java Runtime Environment (JRE), download and install the JDK, delete the Image\ImageJ.cfg file, and restart ImageJ. Compile and Run will not work if you launch ImageJ by double clicking on ij.jar.

Upgrading to Java 1.6

This is what you need to do to upgrade to Java 1.6: This method requires an ImageJ 1.35 or later distribution (ImageJ folder) that includes George Silva's auto-configuring launcher (ImageJ.exe).

Adding a JAR File

Some plugins require a Java code library contained in a JAR file (e.g., Jama.jar). ImageJ's plugin class loader automatically loads code from such libraries as long as the JAR file is in the plugins folder or an immediate subfolder. The Plugins>Compile and Run command in ImageJ 1.39 and later also supports JAR file libraries located in the plugins folder or a subfolder. Note that Compile and Run will not recognize the JAR file if the name does not end in ".jar" or if the name contains an underscore.

About the Installer

The ImageJ Windows installer is created using the Inno Setup installer generator.