- How do I change the Java Virtual Machine (JVM) that MATLAB is using on Windows?
- How do I change the Java Virtual Machine (JVM) that MATLAB is using on macOS?
- How do I change the Java Virtual machine (JVM) that MATLAB is using on Linux?
Why does MATLAB crash at startup with the error "Cannot locate com/mathworks/jmi/OpaqueJavaInterface class"?
139 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2012 年 6 月 22 日
編集済み: MathWorks Support Team
2025 年 1 月 6 日
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.
採用された回答
MathWorks Support Team
2025 年 1 月 6 日
編集済み: MathWorks Support Team
2025 年 1 月 6 日
There are multiple reasons for this error, most commonly it indicates that the post installation configuration failed during the initial installation of MATLAB. In order to work around this issue you can attempt to manually run the post installation tasks by following the instructions contained in the following support answer:
Alternatively, if that does not resolve the error, it may also 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.
and
MATLAB to repair your MATLAB installation. An installation of a different release of MATLAB may also work.
2 件のコメント
Kouichi C. Nakamura
2021 年 11 月 28 日
編集済み: Kouichi C. Nakamura
2021 年 11 月 28 日
I'm getting the same error
Cannot locate or initialize class com/mathworks/jmi/OpaqueJavaInterface.
on macOS 12.0.1. The link mentioned above:
is about how to change JVM. But it is not kind enough tell how to unset. Also, it says:
> This article applies only to MATLAB launched from a shell window or modified shortcut as both of these methods set-up the MATLAB_JAVA variable. Clicking on the regular MATLAB icon will not use the new Java.
My root problem is that I cannot lanch MATLAB by clicking. While investigating this issue, I found an article about launching MATLAB from Terminal, and I received the error above.
Can you elaborate a bit more what I should do next?
Kouichi C. Nakamura
2021 年 12 月 19 日
Following the guide below, I tried Regenerate Preferences, and Start MATLAB from the Installation Folder with no avail. I deleted MATLAB and reinstalled it, and it launched eventually.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!