Login  Register

Re: null pointer exception on instanciating a matlab .jar class from plugin

Posted by Heerpa on Jul 07, 2011; 8:07am
URL: http://imagej.273.s1.nabble.com/null-pointer-exception-on-instanciating-a-matlab-jar-class-from-plugin-tp3683949p3683962.html

Hi Johannes,

On Wed, 6 Jul 2011, Heinrich Grabmayr wrote:
>> One of my m files displays a figure - so that won't be any use with the
>> coder. But will it be displayed via the route of the compiler?
> Yes, if you use Matlab's Compiler, the resulting code will start a Java
> Virtual Machine to display figures, or reuse a running one if it exists in
> the current process (except in Matlab R2010a if memory serves correctly,
> where they had a bug on MacOSX, and only on MacOSX, trying to start a new
> JVM -- even if Compiler JA generated code did not share that problem).
I have now looked into JNI a bit, and how to use that in combination
with Matlab compiler. It doesn't seem to be that straight forward
because you have to embed a java header while creating the dll you want
to use in java later.
http://www.haertfelder.com/jni.html
http://www.mathworks.de/matlabcentral/newsreader/view_thread/73070
the latter modifies the a c code generated by matlab during the build
process and compiles that to a dll which he intends to use from java.
That sounds sensible to me, but it seems not to work. I wouldn't have
any idea on how to do it differently. Can you hint me to the way to go?

Best, Heinrich