MATLAB: Does MATLAB crash at startup with the error “Cannot locate com/mathwo​rks/jmi/Op​aqueJavaIn​terface class”

MATLAB

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.

Best Answer

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.