issue Matlab

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

issue Matlab

Prodanov Dimiter
Dear All,

I am trying to run IJ and plugins from Matlab. In the previous release this was fine but after an upgrade to v. 7.8.0 the issue appeared.
Basically when I try to run a plugin from ImageJ already started in Matlab there is always an exception "plugin or class not found +name"
NoClassDefFound Error ij/plugin/Plugin

I ended up writing my own class loader for ImageJ, which adds all specified directories and jars to the classpath but it did not solve the problem.
I suspect now that there is an issue with the plugin loading mechanism of ImageJ itself.

Note that I use the MIJ interface.

Your feedback is welcome,

Dimiter Prodanov
Reply | Threaded
Open this post in threaded view
|

Re: issue Matlab

dscho
Hi,

On Tue, 13 Apr 2010, Prodanov Dimiter wrote:

> I am trying to run IJ and plugins from Matlab. In the previous release
> this was fine but after an upgrade to v. 7.8.0 the issue appeared.
> Basically when I try to run a plugin from ImageJ already started in
> Matlab there is always an exception "plugin or class not found +name"
> NoClassDefFound Error ij/plugin/Plugin
>
> I ended up writing my own class loader for ImageJ, which adds all
> specified directories and jars to the classpath but it did not solve the
> problem. I suspect now that there is an issue with the plugin loading
> mechanism of ImageJ itself.
>
> Note that I use the MIJ interface.
>
> Your feedback is welcome,

This might help:

http://pacific.mpi-cbg.de/cgi-bin/gitweb.cgi?p=ImageJA.git;a=commitdiff;h=e045174a658da17387a4945c8d9562ae728e8072

Ciao,
Dscho
Reply | Threaded
Open this post in threaded view
|

Re: issue Matlab

Heerpa
Hi,

I have a similar problem:

I can compile my plugin to a .class, and copying that to a working IJ plugin folder. It does appear in the Plugins menu, but clicking on it, I get
"Plugin or class not found: "Testgetsquare_"
(java.lang.NoClassDefFoundError: com/mathworks/toolbox/javabuilder/MWException)"

I use Matlab R2007a, use the deploytool to create .jar s of my .m s and
http://imagejdocu.tudor.lu/doku.php?id=howto:plugins:how_to_set_up_netbeans_to_work_with_imagej_and_matlab_together
to access that from the plugin.

Unfortunately, I am an extreme Java newbie, so I couldn't think of what to do with the link above.
so could anyone please tell me how to resolve this?

one more extremely basic thing: I compile my plugins from .java to .class. It seems to be more convenient to get .jar archives. I tried to modify the ant file for that, but that went wrong. Also zipping and renaming it to .jar was a feeble attempt.. Could anyone help me there, too?

Best H
Reply | Threaded
Open this post in threaded view
|

Re: issue Matlab

Heerpa
Just for people who have this problem in future:
the deployment tool of matlab generates
A.jar and A.ctf.
both of those need to be copied into the plugins folder.

also, the javabuilder.jar of the matlab component runtime needs to be copied into the plugins folder in order to get access to things like the MWException.
Reply | Threaded
Open this post in threaded view
|

Re: issue Matlab

Prodanov Dimiter
In reply to this post by Prodanov Dimiter
Hi,


When I was doing it you also had to statically set the classpath in Matlab.
Dynamic  setting is not recognized by ImageJ class loader.

Best regards,

Dimiter Prodanov
Reply | Threaded
Open this post in threaded view
|

Re: issue Matlab

Heerpa
Hi Dimiter,

Am 06.07.2011 13:46, schrieb Prodanov Dimiter:
> When I was doing it you also had to statically set the classpath in Matlab.
> Dynamic  setting is not recognized by ImageJ class loader.
can you elaborate on this? To my understanding, you set the classpath in
Matlab if you want to access some java class from matlab - but here it
is the other way round, isn't it?

Best, Heinrich