Matlab closing automatically when plotting data or opening an existing saved figure.

14 views (last 30 days)
I am running Matlab (7.5) -R2007b on Mac OSX 10.5.8. Recently I updated java (using auto update in Mac). However, after that I am unable to plot or open a figure in matlab. I can type in command window, but every time I am trying to plot something, Matlab is closing automatically. I even can't open an existing figure. Any help is most welcome.

Answers (4)

Brian Arnold
Brian Arnold on 26 Jul 2011
There is an incompatibility in a recent Java update (1.6.0_26) affecting MATLAB versions R2007a, R2007b and R2008a, that can be worked around by following these steps:
1. Close MATLAB, if it is running.
2. In Terminal or xterm , type:
open -a TextEdit /Applications/MATLAB_R2008a/bin/.matlab7rc.sh
In the path above, change "/Applications/MATLAB_R2008a/bin/" accordingly depending on your version of MATLAB's root folder name.
3. In the editor, navigate to Line 410 to locate:
DYLD_LIBRARY_PATH=
This line is a part of the following code in the "mac" section of matlab7rc.sh:
if [ "$DYLD_LIBRARY_PATH" != "" ]; then
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
else
DYLD_LIBRARY_PATH=
fi
4. Change the line from
DYLD_LIBRARY_PATH
to
DYLD_LIBRARY_PATH=/System/Library/Frameworks/JavaVM.framework/Libraries
For users on MATLAB R2007a and R2007b, after making the change in the "mac" section, make the same change the "maci" section (right below the "mac" section).
5. Save the changes (Command-S).
6. Restart MATLAB.
  1 Comment
Christian
Christian on 30 Aug 2013
The problem is exactly the same as mine (R2007b on Mac OS X 10.5.8) - crash after any plotting. I tried the above, but the "mac" section of my .matlab7rc.sh file has LD_LIBRARY_PATH instead of DYLD_LIBRARY_PATH both times (otherwise the lines are as described above). The "maci" section is exactly as above. I made the change to the "maci" section, no luck. Tried the same change with LD_LIBRARY_PATH=/System/Library/Frameworks/JavaVM.framework/Libraries in the "mac" section, still no luck. No error message, just an ungraceful exit. I'd be very grateful for ideas.

Sign in to comment.


Wayne
Wayne on 8 Jul 2011
Same issue with Matlab R2007b running on Mac OSX 10.6.8. I tried installing an older version of Java, but could not get Matlab to recognize it either through the Java Preferences utility or the the environment variable JAVA_JVM_VERSION.

Marilee Nugent
Marilee Nugent on 22 Jul 2011
I'm having the same problem as Wayne. Does no one have a solution? I'll never finish my PhD at this rate.
  1 Comment
Walter Roberson
Walter Roberson on 23 Jul 2011
I did have one person report that they were able to work again after they reinstalled the previous version of Java.

Sign in to comment.


GeoSklivanitis Sklivanitis
Thank you Brian that really worked for me running R2008a with 10.5.8.

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!