Re: ImageJ Plugin

Posted by dscho on
URL: http://imagej.273.s1.nabble.com/ImageJ-Plugin-tp3700388p3700396.html

Hi,

On Tue, 6 Feb 2007, Hao An wrote:

> I am working on create my plugins. But I keep getting following error
> message:
>
> Plugin or class not found: "My_Plugin"
> (java.lang.NoClassDefFoundError: My_Plugin(wrong
> name:plugins/My_Plugin))
>
> But I am sure I put My_Plugin.java and My_Plugin.class under plugins
> fold.

I answered a similar question recently:

http://article.gmane.org/gmane.comp.java.imagej/6992

The problem is that unless you package the class files, you _must not_ put
the class into a package. In other words, if you remove the line

        package plugins;

from your java file, it will start to work.

Hth,
Dscho