From: Lei Chen on
"Yair Altman" <altmanyDEL(a)gmailDEL.comDEL> wrote in message <hntdj2$l6g$1(a)fred.mathworks.com>...
> "Lei Chen" <chlpd(a)hotmail.com> wrote in message <hnsqss$j0j$1(a)fred.mathworks.com>...
> > "Bart Thijs" <bart.thijs(a)econ.kuleuven.be> wrote in message <hlu5qd$a57$1(a)fred.mathworks.com>...
> > > Hi Yair,
> > >
> > > Thanks for your suggestion but both issues are not the case.
> > > All the methods are public and i used copy/paste.
> > >
> > > I find it very difficult that you get no error message from Matlab when importing a java class. Is there a possibility to check for all loaded classes.
> > > I've seen something like [m,x,j]=inmem but this gives only empty arrays.
> > >
> > > I've tried to include all the used packages in my jar and I can use this jar succesfully outside of Matlab in a jar so every thing seems to be OK with the jar file.
> >
> > I actually have the same problem when I use a third party jar file. Like what you said, if you run javaclasspath, you will see your jar is there, and when you import, there is nothing wrong. But when you call the classes. it says undefined. I am still trying to solve it.
>
>
> place the jar filepath in your static java classpath. To do this, simply type: "edit classpath.txt" in your Matlab Command Window and after adding your JAR(s) restart Matlab
>
> Yair Altman
> http://UndocumentedMatlab.com

Thanks, Yair,
Yes, I did that, and I am quite sure classpath.txt is edited and jar files are there. I am using a third party ones, and their instructions is like this also. So, I am still not sure what is wrong. I also checked with other matlab versions, not working either. But if you have time, I can send you the jar file for a test....

/Lei
From: Yair Altman on
"Lei Chen" <chlpd(a)hotmail.com> wrote...
[...]
> So, I am still not sure what is wrong. I also checked with other matlab versions, not working either. But if you have time, I can send you the jar file for a test....
>
> /Lei


I am a professional consultant, so if you will be willing to compensate me for my time and effort, then I will be happy to help. Feel free to email me.

Yair Altman
http://UndocumentedMatlab.com
From: Mohsen on
On Mar 20, 9:23 am, "Yair Altman" <altmany...(a)gmailDEL.comDEL> wrote:
> "Lei Chen" <ch...(a)hotmail.com> wrote...
>
> [...]
>
> > So, I am still not sure what is wrong. I also checked with other matlab versions, not working either. But if you have time, I can send you the jar file for a test....
>
> > /Lei
>
> I am a professional consultant, so if you will be willing to compensate me for my time and effort, then I will be happy to help. Feel free to email me.
>
> Yair Altmanhttp://UndocumentedMatlab.com

Hi, I am not a professional consultant :D However I had the same
problem and apparently it is because of the version of java being used
in your Matlab and in your java code. Make sure they are using the
same version. For example I was compiling my code using jdk 1.6 while
my Matlab was using jdk 1.5. I changed my main java to 1.5 and then
Matlab was able to load the jar file.

Hope this helps.

Best,
Mohsen