Developing ImageJ in Eclipse
![]() |
![]() |
![]() |
![]() |
This article explains how to install and configure Eclipse for use with ImageJ development. Directions correspond to Eclipse 4.3 Kepler, and may need adjustment for other versions.
Contents
Install and configure Eclipse
Setting up Eclipse on Windows
Install Java Development Kit
Download and install JDK 6 from the Java web site.
Take note of where the Java installation ended up; for the remainder of this guide we will use "C:\Program Files\Java\jdk1.6.0_20" though your path is likely to be different.
Install Eclipse
Download "Eclipse IDE for Java Developers" from the Eclipse web site. It is important to choose "Eclipse IDE for Java Developers" because it contains Maven support built-in.
Unpack the ZIP file to a location of your choice. On Windows 7, to avoid permissions issues, we recommend using your personal Programs folder. Take note of this path; for the remainder of this guide we will use "C:\Users\you\Programs\eclipse" though your path is likely to be different.
Configure Eclipse
Next, use Wordpad to edit the eclipse.ini
file in C:\Users\you\Programs\eclipse. (Do not use Notepad, because it will not handle the Unix-style line breaks properly.) Carefully follow these instructions to specify the proper JDK. Then save the file and quit Wordpad.
Now update Eclipse's JRE to be JDK-aware:
- Launch Eclipse
- From the menu choose Window > Preferences
- Select Java > Installed JREs
- Click Search..., navigate to "C:\Program Files\Java\jdk1.6.0_20" and click OK
- Check the box next to the JRE that appears and click OK
Setting up Eclipse on Mac OS X
Install Eclipse
Download and install "Eclipse IDE for Java Developers" from the Eclipse web site. It is important to choose "Eclipse IDE for Java Developers" because it contains Maven support built-in.
Setting up Eclipse on Linux
Install Eclipse
Download "Eclipse IDE for Java Developers" from the Eclipse web site. It is important to choose "Eclipse IDE for Java Developers" because it contains Maven support built-in.
Unpack the tarball to a location of your choice. To avoid permissions issues, we recommend using a folder in your home directory such as ~/eclipse.
Clone the ImageJ source
Using your Git client of choice, clone the ImageJ source code.
Import the ImageJ source
- Choose File > Import from the Eclipse menu
- Select "Existing Maven Projects" and click Next
- Browse to the folder where you cloned the ImageJ source code
- Click Finish
Launch the program
- In the Package Explorer, expand the project called "imagej"
- Navigate into src/main/java
- Navigate into net.imagej
- Right-click on Main.java
- Choose "Run As" and then "Java Application"