Running Matlab R2024a in conjunction with Oracle JRE 8 Java ( native Apple Silicon version)

72 Ansichten (letzte 30 Tage)
I just upgraded to Matlab R2024a and also installed Java amazon-corretto-11.jdk as part of the installation.
I am using a 3rd party software which interacts with Matlab through Java which now causes issues due to the use of Corretto. I was recommended to switch to Oracle JRE 8 to solve the problem.
Is anybody here successfully running Matlab R2024a for native Apple M1 chip in conjunction with Oracle JRE 8?
On the Oracle download ( https://www.oracle.com/au/java/technologies/downloads/ ) page there are several options for Java 8. I used the ARM64 DMG installer which then shows the following version on my mac:
1.8.0_411 (arm64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk-1.8.jdk/Contents/Home
I also created a java.opts file with the following content:
-Djava.home=/Library/Java/JavaVirtualMachines/jdk-1.8.jdk/Contents/Home
and stored it in /Applications/MATLAB_R2024a.app/bin/maca64/
Now Matlab R2024a is not starting up any more.
Does anybody have any recommendations?

Antworten (1)

Alan
Alan am 5 Jul. 2024
Hi Damian,
MATLAB R2024a in MAC comes with amazon-coretto-8.jdk by default. But it is possible to change the Java version to amazon-coretto-11.jdk, since OpenJDK 11 is listed as one of the compatible Java versions for MATLAB R2024a as mentioned here: https://www.mathworks.com/support/requirements/openjdk.html
It could be possible that you have not properly configured your MATLAB to run the new Java version. To set R2024a to work with amazon-coretto-11, execute the “jenv” function with the new Java home path as follows:
jenv("/Library/Java/JavaVirtualMachines/amazon-coretto-11.jdk/Contents/Home/")
Modify the path string in the above function call if you have installed Java in another directory. After running “jenv”, restart MATLAB to complete the configuration. To confirm the new java version, execute “jenv” in the MATLAB command line.
More information on “jenv” can be found here: https://www.mathworks.com/help/matlab/ref/jenv.html
Regards.

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Produkte


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by