Borrar filtros
Borrar filtros

Importing JAVA class to Matlab - Error

4 visualizaciones (últimos 30 días)
Chintan Patel
Chintan Patel el 29 de Sept. de 2016
Respondida: David Barry el 3 de Oct. de 2016
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'.

Respuestas (1)

David Barry
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.

Categorías

Más información sobre Java Package Integration en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by