필터 지우기
필터 지우기

Matlab 2011 integration with java

조회 수: 1 (최근 30일)
andre albagli
andre albagli 2013년 5월 22일
Guys:
I've been facing a problem with integrating an opensource RTI from Portico which was developed in c++ (MS Visual C++ 2010) and a java library portico.jar developed in java 1.7
The problem is I declare portico.jar in the classpath.txt file and run my program developed in c++ I get the following error messages:
java.lang.UnsupportedClassVersionError: org/jgroups/blocks/RequestHandler : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(Unknown Source) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$000(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.portico.bindings.jgroups.JGroupsConnection.getFederationChannel(JGroupsConnection.java:215) at org.portico.bindings.jgroups.JGroupsConnection.createFederation(JGroupsConnection.java:229) at org.portico.lrc.services.federation.handlers.outgoing.CreateFederationHandler.process(CreateFederationHandler.java:79) at org.portico.utils.messaging.MessageSink.process(MessageSink.java:187) at org.portico.impl.hla1516e.Impl1516eHelper.processMessage(Impl1516eHelper.java:99) at org.portico.impl.hla1516e.Rti1516eAmbassador.processMessage(Rti1516eAmbassador.java:5473) at org.portico.impl.hla1516e.Rti1516eAmbassador.createFederation
Seems that it has to do with the java version used by matlab which is 1.6 (for all versions including the recent 2013).
I need to know if there is a workaround to allow jar files in version 1.7 run with matlab.
Sincerely, Andre Nudel

채택된 답변

Friedrich
Friedrich 2013년 5월 22일
편집: Friedrich 2013년 5월 22일
Hi,
MATLAB uses JAVA 6 so JAVA 7 compiled files wont work. However you can change the JAVA version MATLAB uses by creating an environment variable called MATLAB_JAVA whcih points to the JRE7 installation folder.
This can work but can also lead to undesirable behavior of MATLAB especially selfmade MATLAB GUIs can behave strange.

추가 답변 (1개)

andre albagli
andre albagli 2013년 5월 22일
Friedrich:
Thanks for the answer. Yes you are rigth! I tried to change MATLAB_JAVA but it did not work! When I ran my program the whole matalb crashed!
Seems that even version 2013 still be NOT compatible with java 1.7. Is this true ?
Sincerely, Andre
  댓글 수: 2
Friedrich
Friedrich 2013년 5월 22일
As long MATLAB uses JAVA 6 it's not tested/supported with JAVA 7. It sometimes works fine with JAVA7 and sometimes it crashes. But I am pretty confident that one of the next releases MATLAB will run on JAVA 7.
andre albagli
andre albagli 2013년 5월 22일
thank you!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by