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 comentarios

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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Preguntada:

el 7 de En. de 2015

Comentada:

el 3 de Jun. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by