Difference between revisions of "Developing ImageJ in Eclipse"

(Collapse menu sidebar conditionally)
(Update expand tag)
Line 1: Line 1:
{{Development | ides}}
+
{{Development | source}}
 
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.
 
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.
  

Revision as of 12:17, 3 December 2014

Template:Development 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.

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

  1. Choose File > Import from the Eclipse menu
  2. Select "Existing Maven Projects" and click Next
  3. Browse to the folder where you cloned the ImageJ source code
  4. Click Finish

Launch the program

  1. In the Package Explorer, expand the project called "imagej"
  2. Navigate into src/main/java
  3. Navigate into net.imagej
  4. Right-click on Main.java
  5. Choose "Run As" and then "Java Application"