Why do I get a Java exception when invoking a user-defined Java class in MATLAB 7.5 (R2007b) on Solaris?

I have some user-defined Java classes built using JDK version 1.6.
When I try to import and invoke the class into MATLAB 7.5 (R2007b), I get the following error message:
Warning: A Java exception occurred trying to load the com/arm/libparser/Library class:
Java exception occurred:
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method).....

 採用された回答

MathWorks Support Team
MathWorks Support Team 2009 年 6 月 27 日
This error message is due to an unsupported version of the Java Development Kit (JDK) being used to compile the user-defined Java classes.
The library classes were built using JDK version 1.6, whereas in Solaris 64-bit, MATLAB 7.5 (R2007b) is compatible with JDK 1.5 only.
To resolve this issue, you may either compile the user-defined Java classes using JDK version 1.5 and then invoke it using MATLAB 7.5 (R2007b), or directly call this user-defined Java class in MATLAB 7.6 (R2008a) and 7.7 (R2008b), which are compatible with JDK 1.6.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Call MATLAB from Java についてさらに検索

製品

リリース

R2007b

Community Treasure Hunt

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

Start Hunting!

Translated by