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 $ ./matlabAbort 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_EducationOperating 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)>> desktopError using desktop (line 19)desktop is not supported because:Swing is not currently available.>>
Anyone could share some thots to fix this? Thanks
Best Answer