Borrar filtros
Borrar filtros

Matlab 2011 integration with java

1 visualización (últimos 30 días)
andre albagli
andre albagli el 22 de Mayo de 2013
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

Respuesta aceptada

Friedrich
Friedrich el 22 de Mayo de 2013
Editada: Friedrich el 22 de Mayo de 2013
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.

Más respuestas (1)

andre albagli
andre albagli el 22 de Mayo de 2013
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 comentarios
Friedrich
Friedrich el 22 de Mayo de 2013
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 el 22 de Mayo de 2013
thank you!

Iniciar sesión para comentar.

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by