How can I enable Java in MATLAB R2025a and newer?

I have installed R2025a and newer but see that java is not enabled. How can I enable it? 

 Accepted Answer

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("Hello World!")
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

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 ?
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)

Categories

Products

Release

R2025b

Community Treasure Hunt

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

Start Hunting!