Matlab 2011 integration with java
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
0 commentaires
Réponse acceptée
Friedrich
le 22 Mai 2013
Modifié(e) : Friedrich
le 22 Mai 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.
0 commentaires
Plus de réponses (1)
andre albagli
le 22 Mai 2013
2 commentaires
Friedrich
le 22 Mai 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.
Voir également
Catégories
En savoir plus sur Startup and Shutdown dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!