To Install Eclipse with the Visual Editor
Download the Galileo 3.5 version of Eclipse from http://www.eclipse.org/downloads/. The IDE for Java Developers is a good one to use.
Extract the files to a location on your hard disk. Note that there is no installation of Eclipse required, so if you mess up any of the steps, you can simply delete the extracted files and begin again.
Start Eclipse by clicking on eclipse.exe
In the Workspace Launcher, type in the location where you want to store all of your files and press Enter.
Select Help Install New Software….
In the Install window, click the link in the “Find more software by working with the ‘Available Software Sites’ preferences” link.
Click the Add Button.
In the Add Site window, put in the Name “Releases” and the Location http://download.eclipse.org/releases/galileo
Repeat this for: Visual Editor and http://download.eclipse.org/tools/ve/updates/1.4/
Click Test Connection for each site
When the test has finished Click Ok.
Set the “Work with” dropdown list to Visual Editor – Http://download.eclipse.org/tools/ve/updates/1.4/.
Click the box marked Contact all update sites during install to find required software.
Expand the VE 1.40 item in the list can check the box for Visual Editor.
Click Next
Click Next again.
Click to accept the terms of the license agreement and click Finish.
The software will install.
Click Yes to restart Eclipse.
When Eclipse restarts, confirm the location where you want to keep your development files and click OK.
You will now have the ability to create a new project using the Visual Editor.
To create a plugin for ImageJ
Download and install the Java Development Kit (JDK). The current version as of this writing is JDK 6 Update 16 (http://java.sun.com/javase/downloads/index.jsp)
Create a project.
Start Eclipse.
When the Workspace Launcher starts, enter the directory of the folder where you want all of your files to be stored and click OK (1).
Click the “X” on the “Welcome” tab. This will display the workbench
Click File New Java Project (2).
Next the New Java Project window will appear (3). Put in the Project Name.
Select Use default JRE.
Click Finish.
You now have a project created (4). Click the + sign next to the Project name to see the folders and resources contained in the project.
Configure the Project.
Select Project Properties (5).
Figure
The Properties window will open. Select Java Build Path from the list on the left.
In the Java Build Path window on the right, select the Libraries tab (6).
Click on the Add External JARs button.
Navigate to the tools.jar file in the java development kit directory (Ususally in c:\Program Files\Java\jdk1.6.0_16\lib\tools.jar and click Open (7).
Click on the Source Tab.
Click on the ImageJ Project/src folder and click the Remove (8).
Figure
Click on the Add Folder button.
The Source Folder Selection Window will appear. Click the Create New Folder button (9).
Figure
When the New Source Folder window appears, type the name of the folder where the ImageJ source files will be stored (10). Click Finish.
Click on the Project Name again and then click the Create New Folder button again. Specify the name of the folder where the Plugin source files will be kept. Click Finish.
There should now be two checked folders, both of which are sub-folders of the Project Name folder (11). Click OK.
Back in the Project Properties window, click the “Allow output folder for source folders” checkbox.
Replace the word “bin” with “plugins” in the Default output folder field. If this is not set correctly, then the plugin will not appear in the ImageJ plugin folder.
Click to expand the listing for both the ImageJ source files and the Plugin source files.
Below the line listing the ImageJ Source Files folder, select the line “Output folder: (Default output folder) and click on the Edit button (12).
When the Source Folder Output Location window appears, select the option: Specific output folder (13).
Specify the name of the folder which will hold the ImageJ output files (these will be compiled .class files) and click OK.
Below the line listing the Plugin Source Files folder, select the line “Output folder: (Default output folder) and click on the Edit button.
Specify the name “plugins”. If this is not set correctly, then the plugin will not appear in the ImageJ plugin folder. Click OK.
The Sources are now configured. The configuration should look like 14.
In the list on the left, click on Run/Debug Settings.
Click OK to exit the Project Properties window.
Copy the ImageJ Source files
Download the ImageJ source code from http://rsbweb.nih.gov/ij/download/src/
Extract the files to the ImageJ Source Files directory within the project folder.
In the Eclipse window, select File Refresh. There should now be a + sign next to the ImageJSouceFiles. Clicking this + sign will display all of the ImageJ Source Files (15).
Configure the Run/Debug Settings
Click on Project Properties again.
Click on Run/Debug Settings line on the left (16).
Click the New button
In the Select Configuration Type window which appears, select Java Application and click OK (17).
The Edit Configuration window will appear. Give a name to the launch configuration (18).
Click the Browse button and the Project Selection window will appear (19). Select the project and click OK.
Back in the Edit Configuration window, click on the Search button.
In the Select Main Type window that appears, select “ImageJ – ij” and click OK (20).
Click on the Common tab.
Check the boxes before Debug and Run (21). Then click OK.
Click OK again to exit the Properties window.
Remove the Unused src Folder
Right click on the src folder in the Eclipse window and select Delete (22).
Confirm the deletion by clicking OK on the Confirm Delete dialog (23).
Begin Developing a Plugin
You are now set to develop a plugin for ImageJ. Clicking on the Run or Debug buttons will start ImageJ.
To begin plugin development, right click on the Plugin Source Files folder and select New Class.
In the New Java Class dialog, enter a Name for the class file. Remember that plugins will only appear in the plugin folder listing if they contain an underscore in their name.
You may now begin programming. A Hello World program is:
import ij.IJ;
import ij.plugin.PlugIn;
public class New_Plugin implements PlugIn {
public void run(String arg) {
IJ.showMessage("My_Plugin", "Hello world!");
}
}
You may also start creating GUIs using the visual editor by right click on the Plugin Source Files folder and select New Visual Class