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
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 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 a single plugin ("Plugin_With_Libraries") that calls a static method in two classes with the same name in two different packages.

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

    jar cvfM Plugin_With_Libraries.jar *
JAR files that contain more than one plugin also need a plugins.config file.

|Plugins | Home |