Swing is not available in Mac High Sierra

9 views (last 30 days)
I have recently purchased Arduino Engineering Kit and get an one year license to start using Matlab. I've followed the instruction to install Matlab on my Mac High Sierra.
First I could not start Matlab. I tried to start by command line still no luck.
Searched over the net, some suggested to start with -nojvm, this worked, however this also mean that I will stay in command line only as Matlab GUI all relies on Java AWT and Swing.
I decided to investigate more and realised that I should specify MATLAB_JAVA to either
/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre
or
'/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home' (quote for the space).
Now I can start Matlab with Java enabled. However I still cannot start with GUI. Whenever I start Matlab without -nodisplay option, it crashes:
/Applications/MATLAB_R2018a.app/bin $ ./matlab
Abort trap: 6
/Applications/MATLAB_R2018a.app/bin $
Then I found some articles mentioned Matlab relies on X window as well. So I went to XQuartz and install the latest version, tried to start Matlab under xterm, no luck.
Another try to go to macports and install xorg-server and use X11 to start Matlab, still no luck.
Lastly when I start ./matlab -nodisplay and enable desktop, it said Swing is not available.
/Applications/MATLAB_R2018a.app/bin $ ./matlab -nodisplay
>> ver
---------------------------------------------------------------------------------------------------
MATLAB Version: 9.4.0.813654 (R2018a)
MATLAB License Number: Sponsored_Education
Operating System: Mac OS X Version: 10.13.5 Build: 17F77
Java Version: Java 10.0.1+10 with "Oracle Corporation" Java HotSpot(TM) 64-Bit Server VM mixed mode
---------------------------------------------------------------------------------------------------
MATLAB Version 9.4 (R2018a)
Simulink Version 9.1 (R2018a)
Control System Toolbox Version 10.4 (R2018a)
Curve Fitting Toolbox Version 3.5.7 (R2018a)
DSP System Toolbox Version 9.6 (R2018a)
Image Processing Toolbox Version 10.2 (R2018a)
Instrument Control Toolbox Version 3.13 (R2018a)
Optimization Toolbox Version 8.1 (R2018a)
Robotics System Toolbox Version 2.0 (R2018a)
Signal Processing Toolbox Version 8.0 (R2018a)
Simscape Version 4.4 (R2018a)
Simscape Multibody Version 5.2 (R2018a)
Stateflow Version 9.1 (R2018a)
Symbolic Math Toolbox Version 8.1 (R2018a)
>> desktop
Error using desktop (line 19)
desktop is not supported because:
Swing is not currently available.
>>
Anyone could share some thots to fix this? Thanks
  1 Comment
Walter Roberson
Walter Roberson on 21 Jun 2018
I am not having problems with Swing not found, but I do find that on High Sierra, a short time after I start R2018a (apparently successfully), I get a crash.
R2017b works for me.
I see a hint it might be related to the fact I am using Parallels.

Sign in to comment.

Accepted Answer

Madhu Govindarajan
Madhu Govindarajan on 22 Jun 2018
I would recommend you reach out to MathWorks Technical support to get accurate information regarding different issues you are running into here. This is an installation related issue and hence should be supported no matter the license type.
  1 Comment
Frankie Kan
Frankie Kan on 2 Aug 2018
Thanks, I just gave it another try. Installing Matlab from scratch and starting it up by command line, now the GUI comes up and bingo!
$ cd /Applications/MATLAB_R2018a.app/bin $ ./matlab -nosplash
Thanks for looking into my case!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!