How can I enable java in MATLAB R2025a and newer?

99 visualizaciones (últimos 30 días)
I have installed R2025a and newer but see that java is not enabled. How can I enable it? 

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 8 de Oct. de 2025
Editada: MathWorks Support Team el 8 de Oct. de 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 comentarios
Walter Roberson
Walter Roberson el 17 de Sept. de 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 el 17 de Sept. de 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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Call Java from MATLAB en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

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

Start Hunting!

Translated by