Package debugging/Class unloading

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Package debugging/Class unloading

Joachim Wesner
Hi list,

During course of settíng up a system of (a) common utility package(s)
libraries) to be used with all my plugins,
I´m running into some problems where I do not know the proper solution:

I.e. i´m doing changes/updates in the plugin and probably also to the
package classes if necessary.
However, for the library to work in all plugins in different subdirectories
and to also work while using the
internal compile and run, it turns out that the package directory needs to
be somewhere in the Java classpath,
i.e. I have included the parent directory (in my case plugins itself) in
ImageJ.cfg.

However, this solution has the problem that after ImageJ has loaded the
package classes for the first time,
any recompilation of the package source code does not change the behaviour,
i.e. it seems it does not
update it´s loaded copy of the class (Without restarting ImageJ).
One would need ImageJ to force reload of the class, which, AFAIK seems not
an easy issue in Java!?

There is one "hack" I found that partly solves the problem:
If the plugin directory has a local copy of the package directory, the
package is found while compiling and running
and repeatedly updating the package works.

However, this still has two issues:

A) Each subdirectory has it´s own, probably different copy of the utility
package - just what I would like to avoid

B) (What I only found out recently): For some strange reason, instanceof
does not seem to work with this approach!?

Any ideas? Would the problem go away when using an external Development API
as Eclipse etc.?

Merry Xmas and happy new year!


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________