How can I enable java in MATLAB R2025a and newer?

98 views (last 30 days)
I have installed R2025a and newer but see that java is not enabled. How can I enable it? 

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 8 Oct 2025
Edited: MathWorks Support Team on 8 Oct 2025
Since MATLAB's own graphical user interface is no longer Java-based starting in R2025a, but instead utilizes JavaScript and HTML, Java is no longer automatically loaded at startup.
To check if MATLAB can use the version of Java you have installed, you can run an example command like the following:
java.lang.String(" ")
This should output an empty string as a result and enable Java for the current MATLAB instance.
You can then verify that java was enabled by running the following command:
version -java
  2 Comments
Walter Roberson
Walter Roberson on 17 Sep 2025
when I input
java.lang.String(" ")
Matlab responds
Unable to resolve the name 'java.lang.String'.
is this a sign that something else (beside java) is wrong with my R2025a ?
Walter Roberson
Walter Roberson on 17 Sep 2025
When I try on R2025a Update 1, on my MacOS Intel system,
java.lang.String(" ")
ans =
works, as it does here on MATLAB Answers.
Note that I do not have -nojvm in effect.

Sign in to comment.

More Answers (0)

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!