简体   繁体   中英

Downgrading Matlab java from 7 to 6 in Ubuntu returns an error

I'm trying to downgrade Matlab java from 7 to 6 because of some problem in Ubuntu like problem in creating GUI (using GUIDE) in Matlab.The Application and figures that I created with Matlab R2014a in Windows 8.1 have a lot of problems here.The size,dark Gray colour of windows,design of buttons and graphs changed in ubuntu and more.. .

I read in Matlab Community site and ask ubuntu that I must downgrade java to 1.6 for this problem. So this is my procedure:

sudo apt-get install oracle-java6-installer  (Getting java oracle in terminal)

export MATLAB_JAVA=/usr/lib/jvm/java_6_oracle/jre  (Set Matlab java in terminal-     address is the path of java that downloaded)

After running matlab with ./matlab I have this error :

Fatal Error on startup: Cannot locate or initialize class com/mathworks /jmi/OpaqueJavaInterface. java.lang.UnsupportedClassVersionError: com/mathworks/jmi/OpaqueJavaInterface : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

I'm downgrading java 1.7 of Matlab R2014a to 1.6. When I use downloaded java 1.7 with terminal and connect it to Matlab there isn't any problem so I think the problem is only in downgrading it to 1.6.

Thanks.

PS. This is some other discussion that may help: When I run guide in matlab it opens a blank all gray window. Whats going on?

You mixed something up. The question is about Matlab R2012b, which was originally build and shipped and shipped with Java 6. Using Java 7 here causes some minor problems but is possible.

You are using Matlab R2014a which was build and shipped with Java 7, due to the fact that Java has no forward compatibility, a Java 6 runtime environment can not load the classfiles.

Matlab Automation is okay simply due to the fact that it does not require JRE.

Use Java 7, your problems must be caused by something else. Java 7 is the correct version for R2014a

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM