0

While attempting to start Matlab R2013b in Ubuntu, I get the following dialog box with an error message and Matlab crashes and closes. Can someone explain the error and how to rectify it? enter image description here

4
  • do you get the same error if you run without a graphical interface? (i.e. matlab -nodesktop -nosplash) Commented Jul 26, 2016 at 21:18
  • or, matlab -nodisplay even. Commented Jul 26, 2016 at 21:21
  • @TasosPapastylianou No error that way! But IDE-based GUI is much more convenient than command-line. Commented Jul 26, 2016 at 21:29
  • 1
    Sure, I was just checking if your error is related to the GUI / Xdisplay rather than the JVM itself. Seems that way. What java are you using on your machine? If all else fails, Octave has a lovely gui these days btw :p Commented Jul 26, 2016 at 21:53

1 Answer 1

1

This is a known JDK bug. It is addressed in this question pretty thoroughly from the java perspective.

When it comes to Matlab, you options seem to be (apart from upgrading Matlab and/or OS):

  1. Add the following JVM startup option through java.opts file:

    -Djava.util.Arrays.useLegacyMergeSort=true

  2. Use a different java version by setting MATLAB_JAVA environmental variable. It may result in all sorts of side-effects, depending on which Matlab / Java combination you end up using.

Sign up to request clarification or add additional context in comments.

11 Comments

It comes with its own JVM on all operating systems. It does not respect windows JAVA_HOME environmental variable as mentioned in this answer, and pretty sure the same is true for linux. You need to set MATLAB_JAVA instead.
You can find the list of bundled JVM versions for Matlab releases on the wiki page. Using a different major java version would likely result in severe issues. Using a different minor version should be ok. I would strongly advise, though, to try setting useLegacyMergeSort flag via java.opts first. It is much simpler and should not result in any problems.
Just add this line to java.opts. Read the docs on how to start Matlab properly so JVM would pick up this configuration (one option is to have java.opts in the same directory you start Matlab in).
@user_1_1_1 if the above fails, then yes, try Octave, it's not always 100% compatible but I've had very few problems I couldn't work around, and basic functionality is all there. On linux if you want the latest version you'd have to compile from source though, which, if you've not done before, you might stumble there. Also, what ubuntu do you have? If it's an older version, it may be worth trying on a newer ubuntu version?
happy to help if you get stuck building from source. just drop me a line.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.