http://www.mathworks.com/support/solutions/en/data/1-F37IJB/
================================================
<Step 1>:
Close MATLAB, if there is any session open.
<Step2>:
Locate the file, 'matlab7rc.sh' as follows:
In Mac Terminal or (X11) xterm , type:
open -a TextEdit $MATLABROOT/bin/.matlab7rc.sh
in which $MATLABROOT is the output of "matlabroot" from the MATLAB command prompt.
For example, for MATLAB R2008a:
open -a TextEdit /Applications/MATLAB_R2008a/bin/.matlab7rc.sh
<Step3>:
Open the matlabrc.sh file in the editor to replace a line as follows:
1. 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
2. Change the 4th line in the code mentioned above from
DYLD_LIBRARY_PATH=
to
DYLD_LIBRARY_PATH=/System/Library/Frameworks/JavaVM.framework/Libraries
<Step 4>:
For users on MATLAB R2008a, directly go to Step 5.
For users on MATLAB R2007a and R2007b, after making the change in the "mac" section, make the same change the "maci" section. This section is right below the "mac" section.
<Step 5>:
Save the changes by pressing "Command" + "s" keys.
<Step 6>:
Restart MATLAB.
================================================