0

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?

Community
  • 1
  • 1
Eghbal
  • 3,892
  • 13
  • 51
  • 112

1 Answers1

1

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

Daniel
  • 36,610
  • 3
  • 36
  • 69
  • Thank you @Daniel for reply. You can check this link : http://www.mathworks.com/matlabcentral/answers/132496-guide-gui-s-are-all-blank-gray-boxes-something-is-wrong . His problem is same in the Matlab that is running version 1.7. I cant find any solution for my problem. It is confusing... – Eghbal Jun 20 '14 at 21:47
  • I think that @user2991243 is right. The problem is with Java. Matlab does not run properly with java 7 on linux. – lord.garbage Aug 22 '14 at 13:48
  • 1
    With the details above, I can only say that using java 7 is the right version. – Daniel Aug 22 '14 at 13:55