Example for a simple IJ2 / Fiji Plugin

Wonder how to write a IJ2 / Fiji Plugin (Command) that can run nicely from within Eclipse and Fiji or ImageJ2?

There are several answer Google gives you, and most of them go the old IJ (1) way. If you want to use ops or any of the IJ2 services you will appreciate this:

https://github.com/imagej/imagej-tutorials/blob/9baa3bffded39736c0e41cb46ddba7dc15f88260/simple-commands/src/main/java/OpenImage.java#L92-L105

Or this one (which also uses ops to work on images):

https://github.com/imagej/imagej-tutorials/blob/master/simple-commands/src/main/java/OpenScaleSaveImage.java