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:
- Check your Java version using `java -version` in the terminal, as MATLAB requires a specific Java Runtime Environment (JRE).
- If multiple Java versions are installed, set the `MATLAB_JAVA` environment variable to the path of the desired JRE for MATLAB.
- 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!