Using Packages for Utility Classes

Author: Wayne Rasband (wsr at nih.gov)
History: 2002/01/09: First version
2006/07/11: Packaged as JAR file
2009/04/22: Added second plugin
Source: Included in Plugin_With_Libraries.jar. To open a JAR file, change the extension to ".zip" and double click on it.
Installation: Download Plugin_With_Libraries.jar into the plugins folder, or a subfolder, and restart ImageJ.
Description: This is an example of how to use Java packages for utility classes, avoiding possible class name collision problems. The JAR file contains two plugin ("Plugin_Using_Libraries1" and "Plugin_Using_Libraries2") that call a static method in two classes with the same name in two different packages.

To compile the plugins, remove the JAR file from the plugins folder, extract the files to a folder in the plugins folder, restart ImageJ and compile each plugin using Plugins/Compile and Run. Create a new JAR file using

    jar cvfM Plugin_With_Libraries.jar *

|Plugins | Home |