Build Plugins in Netbeans


I’m reaching out because I’ve been working on this for days now but to no avail.

I started by pulling this version of ImageJ down into my NetBeans using Git > Clone: git://

Once downloaded, there is a directory called “Plugins” with a readme that says “Plugins go here”, yet no matter what I do to get plugins i have built in there, they just won’t work. I’ve even tried creating a simple hello world one and I can’t get it to appear in the ImageJ plugins menu.

I am reading online things about updating the POM.xml file, but I am new to this so am so confused as to where to start.

Currently, I’ve built a plugin which is spread across 4 classes (files) and I just want it to appear in my NetBeans ImageJ, because I have managed to successfully do this with my normal installation (which I think from what I’m reading online is ImageJ 1).

Please help!


Hello Ryan,

To start developing plugins for ImageJ, you don’t need to clone imagej. You can simply start a new Maven project, which declares the following in the POM file:

  <relativePath />



I.e. you declare that your plugin project uses ImageJ as its parent, you tell where the parent pom can be found, and also declare a dependency on the imagej artefact.

Your plugin doesn’t have to go into the plugins folder. ImageJ discovers available plugins automatically base on the @Plugin annotation. Your class should look like:

@Plugin(type = Command.class, menuPath = "Plugins>My plugin")
public class MyPlugin implements Command {
  public void run() {
    // This is where the magic of your plugin happens

Then you can launch ImageJ and run your plugin as following:

public static void main(final String... args) {
  // Launch ImageJ as usual.
  final ImageJ ij = net.imagej.Main.launch(args);

  // Launch our "Hello World" command right away.
  ij.command().run(MyPlugin.class, true);

Best Regards,
Richard Domander

P.S. For more info have a look at:


Thank you so much!

I stumbled across this link and it made things a little clearer:

But your answer is fantastic and made it even more clear.