Creation of a new plug-in in Eclipse (beginner's question)

Dear all,

I want to try out java plug-ins from the book Digital Image Processing (Burger/Burge). However, I have no experience with Java and Eclipse and got stuck in setting up Eclipse properly.

What I did:
I integrated ImageJ to Eclipse following and could start it.

I want to test a class from the book (e.g. ).
Where in the imagej-tree in Eclipse would I create this class?
What else do I have to consider?

Thank you for your help!

Dear @aklemm,

you should take a closer look at

This will direct you to a GitHub repository that contains a minimal ImageJ(1) plugin. After you have imported this project into Eclipse,you can place the classes from the book in the same directory (i.e. src/main/java) as

You will have to consider, that the excerpt you have posted does not contain a main method. Therefore, you will not be able to run it directly from within Eclipse. For further information, revisit



Dear Stefan,

thank you very much for your help!
I imported the minimal ImageJ(1) plugin to Eclipse, copied the book-example, built the project, copied the Process_Pixels-0.1.0-SNAPSHOT.jar file to the .jar folder in Fiji, and installed it in Fiji. Here appears under Process>Process Pixels.
And that is where I struggle now:

  • running Process Pixels doesn’t open the clown anymore, but opens the interface (is that normal?)
  • Where would I find the book example?

If you could guide me to more information this would be great. Thank you.

Good morning @aklemm,

the creation of menu items for custom plugins in ImageJ1 is controlled by a plugins.config file that you can find in src/main/resources. You have to create an entry (i.e. add a line) for your plugin:

Process, "Anna's Inverter", My_Inverter_A

This will add the book example to the menu in ImageJ. For more information you can take a look at as well as the awesome tutorial on ImageJ plugin development by Werner Bailer.

running Process Pixels doesn’t open the clown anymore, but opens the interface (is that normal?)

This is entirely normal since you are executing your plugin with two different mechanisms:

  1. When starting a plugin from within Eclipse it treats the class you are executing (per default) as a standalone Java application. Hence, the main method of the class will be executed, which contains the code to load the clown sample image.

  2. When a plugin is started from the ImageJ menu, ImageJ will take care of executing the setup method and once you click the menu entry of calling the run method. This run method also contains the code to generate a dialog, which I guess is the “interface” you are referring to?



Dear Stefan,

yes, now it works - great!
Indeed, I meant the dialog window with interface.
Thanks so much for your explanations and the links, they were very useful for me.