Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
call masked java class

Subject: call masked java class

From: Alexander

Date: 6 Feb, 2012 15:22:09

Message: 1 of 3

Hi, I want to know is there any way to call masked java class?

I want to use DefaultGroupTableModel from JIDE Grids. The problem is that matlab is shipped with Jide ver 2.7.7, which does not have all the features I need. I have the newer jide version, but there comes the problem:

1) If I simply use javaaddpath(), it adds the new jar to dynamic classpath, and it is masked by the jar from static classpath.

2) I can add new jar to static class path using ClassPathHacker:

http://stackoverflow.com/questions/3580752/java-dynamically-loading-a-class/3581598#3581598ClassPathHacker.java

but it is still masked by the matlab's old version (apperently it adds new file to the end of static class path).

Btw, you can verify where java class is loaded from using nice script from:

http://stackoverflow.com/questions/4376565/java-jpa-class-for-matlab

3) I can actually replace all jide jars in \MATLAB\R2010b\java\jarext\jide, and it works. But side effect is that Matlab is not completely compatible with new version (Help, Variable Editor and some other stuff doesn't work properly).

So, is there any way to call the class from newer Jide version, without replacing old jars that are needed for correct work of Matlab?

Thanks in advance,

Alexander.

Subject: call masked java class

From: Yair Altman

Date: 7 Feb, 2012 02:10:10

Message: 2 of 3

"Alexander " <student_vmk@mail.ru> wrote in message <jgor71$2an$1@newscl01ah.mathworks.com>...
> Hi, I want to know is there any way to call masked java class?
>
> I want to use DefaultGroupTableModel from JIDE Grids. The problem is that matlab is shipped with Jide ver 2.7.7, which does not have all the features I need. I have the newer jide version, but there comes the problem:
>
> 1) If I simply use javaaddpath(), it adds the new jar to dynamic classpath, and it is masked by the jar from static classpath.
>
> 2) I can add new jar to static class path using ClassPathHacker:
>
> http://stackoverflow.com/questions/3580752/java-dynamically-loading-a-class/3581598#3581598ClassPathHacker.java
>
> but it is still masked by the matlab's old version (apperently it adds new file to the end of static class path).
>
> Btw, you can verify where java class is loaded from using nice script from:
>
> http://stackoverflow.com/questions/4376565/java-jpa-class-for-matlab
>
> 3) I can actually replace all jide jars in \MATLAB\R2010b\java\jarext\jide, and it works. But side effect is that Matlab is not completely compatible with new version (Help, Variable Editor and some other stuff doesn't work properly).
>
> So, is there any way to call the class from newer Jide version, without replacing old jars that are needed for correct work of Matlab?
>
> Thanks in advance,
>
> Alexander.


You can selectively replace items on the static classpath by editing the %matlabroot%\toolbox\local\classpath.txt file. Or you can move your JARs to the top of the list in that same file.

To fix the compatibility issue with Matlab's Help etc., try using a non-latest version of JIDE. A lot of changes happened between 2.7.7 (dated exactly 2 years ago) and the latest version (currently 3.3.4). The full list is given in http://www.jidesoft.com/history/ - try using JIDE versions at 3-6 month increments until you find one that works for both your needs and Matlab's.

For anyone interested, using JIDE tables (grids) in Matlab is extensively discussed in Sections 4.1 and 5.7 of my Matlab-Java Programming book.

Yair Altman
http://UndocumentedMatlab.com
 

Subject: call masked java class

From: Alexander

Date: 7 Feb, 2012 07:15:10

Message: 3 of 3

"Yair Altman" wrote in message <jgq162$93b$1@newscl01ah.mathworks.com>...
> "Alexander " <student_vmk@mail.ru> wrote in message <jgor71$2an$1@newscl01ah.mathworks.com>...
> > Hi, I want to know is there any way to call masked java class?
> >
> > I want to use DefaultGroupTableModel from JIDE Grids. The problem is that matlab is shipped with Jide ver 2.7.7, which does not have all the features I need. I have the newer jide version, but there comes the problem:
> >
> > 1) If I simply use javaaddpath(), it adds the new jar to dynamic classpath, and it is masked by the jar from static classpath.
> >
> > 2) I can add new jar to static class path using ClassPathHacker:
> >
> > http://stackoverflow.com/questions/3580752/java-dynamically-loading-a-class/3581598#3581598ClassPathHacker.java
> >
> > but it is still masked by the matlab's old version (apperently it adds new file to the end of static class path).
> >
> > Btw, you can verify where java class is loaded from using nice script from:
> >
> > http://stackoverflow.com/questions/4376565/java-jpa-class-for-matlab
> >
> > 3) I can actually replace all jide jars in \MATLAB\R2010b\java\jarext\jide, and it works. But side effect is that Matlab is not completely compatible with new version (Help, Variable Editor and some other stuff doesn't work properly).
> >
> > So, is there any way to call the class from newer Jide version, without replacing old jars that are needed for correct work of Matlab?
> >
> > Thanks in advance,
> >
> > Alexander.
>
>
> You can selectively replace items on the static classpath by editing the %matlabroot%\toolbox\local\classpath.txt file. Or you can move your JARs to the top of the list in that same file.
>
> To fix the compatibility issue with Matlab's Help etc., try using a non-latest version of JIDE. A lot of changes happened between 2.7.7 (dated exactly 2 years ago) and the latest version (currently 3.3.4). The full list is given in http://www.jidesoft.com/history/ - try using JIDE versions at 3-6 month increments until you find one that works for both your needs and Matlab's.
>
> For anyone interested, using JIDE tables (grids) in Matlab is extensively discussed in Sections 4.1 and 5.7 of my Matlab-Java Programming book.
>
> Yair Altman
> http://UndocumentedMatlab.com
>

The idea with versions is good, but it doesn't help. The feature I need (->(Grids) Made GroupTableHeader and NestedTableHeader could work together with AutoFilterTableHeader.) is only available from 3.1.0, and Matlab has compatability problems at least from 2.11.4

Changing classpath.txt will have the same result as just replacing the Jars, i.e. I will still have problems with Matlab's Help and Variable Editor. I guess I'll just have to live with it is there's no other option...

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us