MATLAB Answers

Why does MATLAB crash at startup with the error "Cannot locate com/mathwo​rks/jmi/Op​aqueJavaIn​terface class"?

408 views (last 30 days)
When I start MATLAB, I receive a "Fatal Error On Startup" window that says:
Cannot locate com/mathworks/jmi/OpaqueJavaInterface class
When I click the OK button, the window disappears and MATLAB does not start.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 20 May 2019
Edited: MathWorks Support Team on 20 May 2019
This error may occur if you have set a MATLAB_JAVA environment variable for a previous version of MATLAB. If this variable is set, you will need to unset it in order to run MATLAB. For more information on MATLAB_JAVA, see one of the following articles:
This error can also be caused by a java.opts file on the MATLAB path. If you are using Windows and you have checked your path for java.opts files, but you are still receiving this error, make sure the "Start in" field in your shortcut is set to a directory that doesn't contain a java.opts file.
If MATLAB_JAVA is not set and java.opts is not present, then your MATLAB installation may be corrupt. Uninstall and reinstall MATLAB to repair your MATLAB installation.
Jerry archamabult
Jerry archamabult on 28 Feb 2018
how can one enter matlab commands on the matlab command line to check out or set a MATLAB_JAVA environment variable if matlab does not open ?

Sign in to comment.


No tags entered yet.


Community Treasure Hunt

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

Start Hunting!