Upgrade matlab's jre or downgrade newly written java code

3 次查看(过去 30 天)
Hello! My problem is, that I would like to use an external java class in my Matlab program. I use R2012b, with jre 1.6.0_17-b04. The problem occures when I would like to use a class compiled with jdk 1.8. I tryed nearly everything that I have found on the internet. The one, that I set Netbeans to compile with JDK 6 is not working (though Matlab "sees" the class and creates an instance of it, but throws just error messages when I use any method of it which is not printing on the screen), I don't know, why. The compiler of the Netbeans throws an error message:
warning: [options] bootstrap class path not set in conjunction with -source 1.6
I can not solve this bootstrap question too...
The second (although working) way to start Matlab with jre 1.8 (on Windows):
C:\> set MATLAB_JAVA=C:\Program Files\java\jre1.8.0_111
Then start Matlab from the command window (just from the command window, outside of it this setting above worth nothing).
So that is a working solution.
BUT. I have to solve that this java class work on every computer, even with newer versions of Matlab, because the disadvantages are greater than the advantages, if it doesn't work on every computer (just because of jre version mismatches). The problem is, that I have quite a few Java knowledge, but I wrote a method in JAVA wich computes 3.5 times faster than str2num, and I would like to enjoy the advantages given by that method, but cannot solve this minor(?) problem...
Thank you for your answers in advance!
p.s.: Is there any way to ask Matlab to compile the source code for itself?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Call Java from MATLAB 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by