Importing JAVA class to Matlab - Error
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am using Matlab 2016b. I compiled a java program, and modified the classpath.txt file in Matlab to include the .class and .jar file created after compiling the java program in Eclipse IDE. When I try to access the Java class in Matlab I get the following error:
Warning: A Java exception occurred trying to load the ITWOM_Release class: Java exception occurred: java.lang.UnsupportedClassVersionError: ITWOM_Release : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
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$100(Unknown Source)
at java.net.URLClassLoader$1.run(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 java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.mathworks.jmi.OpaqueJavaInterface.findClass(OpaqueJavaInterface.java:181)
Undefined function or variable 'ITWOM_Release'.
0 comentarios
Respuestas (1)
David Barry
el 3 de Oct. de 2016
This is probably a Java version mismatch. It sounds like you might have compiled using a newer version of Java (possibly JDK 1.8) than MATLAB is using (1.7). You will need to adjust your compiler settings in Eclipse and re-compile.
0 comentarios
Ver también
Categorías
Más información sobre Call Java from MATLAB en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!