필터 지우기
필터 지우기

Importing JAVA class to Matlab - Error

조회 수: 4 (최근 30일)
Chintan Patel
Chintan Patel 2016년 9월 29일
답변: David Barry 2016년 10월 3일
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'.

답변 (1개)

David Barry
David Barry 2016년 10월 3일
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.

카테고리

Help CenterFile Exchange에서 Java Package Integration에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by