Login  Register

Re: Path problem?

Posted by Stephan Saalfeld on Jan 18, 2010; 9:04am
URL: http://imagej.273.s1.nabble.com/Path-problem-tp3689668p3689679.html

Put either the sources together in one path or give a package
declaration to your first plugin (the equivalent to a namespace in C++).
For non-trivial plugins this is anyway the better idea.

You can then import that plugin by

import mynamespace.FirstPlugin;

similar to

using mynamespace::FirstPlugin;

to announce mynamespace.FirstPlugin to ImageJ, you need a hack called
plugins.config in the jar file that contains it or in the plugins folder
alternatively to define what to call under which menu point.
Explanation here:

http://rsbweb.nih.gov/ij/plugins/jar-demo.html

Best,
Stephan



On Sun, 2010-01-17 at 16:28 -0600, Bob wrote:
> I recently started using ImageJ and Java (I am an experienced C++ programmer).  I am working on WinXP, SP3, ImageJ 1.42q, and Java 1.6.0_16.  I wrote my first plugin, and that went smoothly.  When I wrote the second plugin, I needed methods from the first plugin, so I imported it.  When I try to compile it, I get the error message "Package XYZ_ does not exist", pointing to the import line.  I am guessing the problem is that the compiler cannot find the XYZ_.class file.  I have added the path to the folder containing the file to the system variable PATH, but this did not resolve the problem.  Does anybody know how to get the compiler to link this file?
>
> Thanks to anyone who can help.