What are the plans to to use Java11 in future MATLAB releases? So far is still using Java 1.8, but Java 11 is now standard default version at many Linux distributions.
Is there any info regarding posibilities to call compiled Java (v1.8) jar files from MATLAB when MATLAB switch its internal Java to the v1.11?

7 comentarios

John D'Errico
John D'Errico el 30 de Ag. de 2022
Editada: John D'Errico el 30 de Ag. de 2022
Why should there be any plans at all?
In fact, 18 now seems to be the current official release, with several more releases soon to come. (Maybe. Plans are just plans, and sometimes plans change.)
It has been many years since the release you mention. So why should they suddenly decide they need to use a more recent release?
Michal
Michal el 30 de Ag. de 2022
Editada: Michal el 30 de Ag. de 2022
Why not? This is normal SW development progress ...
So, I am expecting sooner or later switch to the newer Java LTS release Java 1.11 as an internal java engine together with MATLAB release, because:
  1. Java 1.11 is really a current Java production version for many, many... Java programmers
  2. JAR files compiled by Java 1.8 is not possible to run from the MATLAB with Java 1.11 internal engine
Ennio Visconti
Ennio Visconti el 24 de Abr. de 2023
Michal
Michal el 24 de Abr. de 2023
@Ennio Visconti This significantly change the @Walter Roberson response here! So TMW decided to keep full java support even for newer Java releases. That is good news! Thanks
Michal
Michal el 24 de Abr. de 2023
@Ennio Visconti Please put your comment as an Answer.
Ennio Visconti
Ennio Visconti el 24 de Abr. de 2023
@Michal sry, I thought I did, I don't get a lot how this platform works. Thanks!
Ennio Visconti
Ennio Visconti el 24 de Abr. de 2023
Editada: Ennio Visconti el 24 de Abr. de 2023
@Michal at least, supporting Java 11 means that it's post java-modules era, so what we are trying to do now is to have just one module that is compatible with matlab, and all the others that are more recent, so that at least when interacting from Java you can actually use recent Java versions (the other way around is still problematic if you go above Java 11).
Hopefully future updates will be faster, the critical one was moving from java 8 to 9, where most companies got stuck.
Maybe in 2024 they could switch to Java 17, who knows :)

Iniciar sesión para comentar.

 Respuesta aceptada

Ennio Visconti
Ennio Visconti el 24 de Abr. de 2023

0 votos

1 comentario

Michal
Michal el 24 de Abr. de 2023
Thanks again @Ennio Visconti ... This is really good news. I should read release notes more carefully :)

Iniciar sesión para comentar.

Más respuestas (1)

Walter Roberson
Walter Roberson el 30 de Ag. de 2022

0 votos

Mathworks will never be switching to Java 11.
Mathworks is engaged in a multi-year process of getting rid of Java for their tools and toolboxes.
The whole uifigure / App Designer exists to get rid of Java.
Why is MATLAB not doing minimal updates to keep current while still proceeding with conversion efforts? It is because every version after the current version requires that end users pay Oracle a per-desktop license fee.
... No, I do not mean a per-user license fee, I do mean a per-desktop license fee. Each virtual machine must be licensed separately, no matter how long the virtual machine lasts. Also, as the language of the license is not specific about what a "desktop" is, it could certainly be interpreted that if you use the MS Windows "switch desktop" feature or the MacOS multiple-desktop feature, that you must license Java for each one of those views.
Historically Oracle only charged fees for the Developer version, but they switch to charging end users as well. And they have a reputation for being litigation-happy.

14 comentarios

Michal
Michal el 30 de Ag. de 2022
This is very surprising answer. Really!
Walter Roberson
Walter Roberson el 30 de Ag. de 2022
Java® packages and subpackages will not be available in MATLAB® in a future release. To continue using a Java package, install its JAR file and add the JAR file to the static path in MATLAB using the instructions in Static Path of Java Class Path.
Michal
Michal el 30 de Ag. de 2022
Thanks for the official TMW links.
Michal
Michal el 30 de Ag. de 2022
Editada: Michal el 30 de Ag. de 2022
So, I still do not understand how to be modified following code in a case of Java Packages remove in future MATLAB releases.
% init
javaaddpath(fullfile(javajarpath,'/alg.jar'));
jmethod = ALG;
% run alg (as external JAR compiled java file) with input "parameters"
output = jmethod.alg(parameters);
Any hints?
Michal
Michal el 30 de Ag. de 2022
In other words: What exactly should the Matlab users do after remove of Java packages from the future Matlab release, in case if they still need to run external JAR files?
Steven Lord
Steven Lord el 30 de Ag. de 2022
At that future time, if the documentation and the Release Notes don't provide enough information or guidance please ask here on MATLAB Answers and/or contact Technical Support.
Michal
Michal el 30 de Ag. de 2022
@StevenLord I am asking now, because this is very important for my curent decisions regarding my matlab apps development projects. Just to be proactive...
Walter Roberson
Walter Roberson el 30 de Ag. de 2022
Mathworks has the goal of rewriting so that at some point, java will not be required for any Mathworks supplied tools or apps.
This is a long term goal; as it gets closer to being reached, you will start seeing Mathworks deprecate "traditional" at least some "traditional" graphics objects, as they rely on Java internally. For example uicontrol() requires Java internally.
I would tend to suspect that for a fair period, Mathworks will continue to support calling into user-provided Java, perhaps similar to the way it currently supports interfacing with Python (that is, user has to provide the software... and any licenses appropriate.) The goal is that users should routinely be able to execute MATLAB and tools without needing Java installed, and so users would not be required to pay Oracle -- but users who have particular reason to do so would still be able to invoke external Java (at their own expense.)
Michal
Michal el 31 de Ag. de 2022
Editada: Michal el 31 de Ag. de 2022
@Walter Roberson Yes, this future transition scenario of MATLAB Java support would be acceptable.
But anyway, the official (TMW) Java support road-map with future release milestones would be very helpful for many MATLAB apps developers.
Chris Rygaard
Chris Rygaard el 11 de Sept. de 2022
The reason you give for getting away from Java does not make sense to me. Many corporations are moving to OpenJDK because (1) it does not have a per-user license, even for their customers, (2) it is very well supported, and (3) it is fully compatible with Oracle JDK. Could you please clarify?
Walter Roberson
Walter Roberson el 12 de Sept. de 2022
Mathworks is also aiming to make the graphics be based upon javascript and HTML5 so that the graphics can be provided remotely (and have more degree of customization.)
Mathworks has not discussed OpenJDK with me.
Ennio Visconti
Ennio Visconti el 24 de Abr. de 2023
Editada: Walter Roberson el 30 de Ag. de 2023
Thanks for the great insights, however they seem to support Java 11 since the latest release (R2023a): https://it.mathworks.com/help/matlab/release-notes.html
Roger
Roger el 30 de Ag. de 2023
The OpenJDK is always available for Matlab to use, instead of the Oracle JDK. Your point is moot.
Andrew Janke
Andrew Janke el 16 de Nov. de 2023
> ...pay Oracle a per-desktop license fee... No, I do not mean a per-user license fee, I do mean a per-desktop license fee... as the language of the license is not specific about what a "desktop" is
LOL, it's Oracle licensing. You'd have to hire a consultant just to figure out how much it's actually going to cost you.

Iniciar sesión para comentar.

Productos

Versión

R2022a

Etiquetas

Preguntada:

el 30 de Ag. de 2022

Comentada:

el 16 de Nov. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by