Matlab Builder JA - Unsupporte​dClassVers​ionError: Unsupported major.minor version 52.0

Hi, While trying to use the Matlab Builder JA toolbox (deployment tool), we can't make work the Library compiler to create a Java package with our Matlab exported function (Matlab file attached to this message). We followed the tutorial and worked intensively on the examples available in the Matlab documentation at the Matlab Builder JA toolbox. Then, we used the createMatlabShortcut.m to launch the Matlab with the right JVM version but it didn't work. Please could you help us with this problem. Best regards, Stéphane

댓글 수: 3

I am experiencing the same issue.
Same error here when trying to compile any Matlab function in a Java Package.
Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.UnsupportedClassVersionError: com/sun/tools/javac/Main : Unsupported major.minor version 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482) Error: An error occurred while shelling out to javac (error code = 1). Unable to build executable (specify the -v option for more information).
You need to use jdk1.7.0 instead of jdk1.8.0. To make sure it, you need to delete jdk1.8.0 on your computer. If you use mac, you need to delete: /Library/Java/JavaVirtualMachines/jdk<version>.jdk /Library/PreferencePanes/JavaControlPanel.prefPane /Library/Internet Plug-Ins/JavaAppletPlugin.plugin Then, you need to reinstall jdk1.7.0, and you will succeed to generate the .jar file.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Deploy to Java Applications Using MWArray Data API에 대해 자세히 알아보기

질문:

2015년 1월 7일

댓글:

2015년 6월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by