装Java后MATLAB无法运行

9 ビュー (過去 30 日間)
伯森
伯森 2023 年 11 月 6 日
回答済み: Chetan 2023 年 11 月 17 日
通过vscode装了Java,之后安装了IDEA,现在MATLAB完全无法使用,打开后无法允许.m文件,并且在打开一小段时间后就会崩溃。
想知道如何修复Java环境。

回答 (1 件)

Chetan
Chetan 2023 年 11 月 17 日
Hello @伯森
I understand you installed Java via VSCode and IDEA, and now you're unable to use MATLAB, as it can't run .m files and crashes shortly after opening.
This issue could be due to MATLAB's Java environment being affected by the other installations. Here's a brief guide to rectify this:
  1. Check your Java version using `java -version` in the terminal, as MATLAB requires a specific Java Runtime Environment (JRE).
  2. If multiple Java versions are installed, set the `MATLAB_JAVA` environment variable to the path of the desired JRE for MATLAB.
  3. If the issue persists, consider reinstalling MATLAB. This process will establish its own Java environment, separate from the system's.
For more details on changing the JRE used by MATLAB, refer to the following MathWorks Documentation: https://www.mathworks.com/matlabcentral/answers/130359
I hope this helps!

カテゴリ

Help Center および File Exchange启动和关闭 についてさらに検索

タグ

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!