Error on startup : Cannot locate or initialize class com/mathwo​rks/jmi/Op​aqueJavaIn​terface.

조회 수: 31 (최근 30일)
I am on Manjaro Linux and I installed Matlab R2024b.
When trying to start Matlab, I get the following error :
Cannot locate or initialize class com/mathworks/jmi/OpaqueJavaInterface.
java.lang.NoClassDefFoundError: com/mathworks/jmi/OpaqueJavaInterface
Caused by: java.lang.ClassNotFoundException: com.mathworks.jmi.OpaqueJavaInterface
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
I tried changing the java version used by using matlab_jenv to switch to the default version on my machine, 1.7. It did not make a difference. Command:
sudo ./matlab_jenv -allusers system  1 ✘
Result:  1 ✘
JavaEnvironment with properties
Version : openjdk version "17.0.13" 2024-10-15
OpenJDK Runtime Environment (build 17.0.13+11)
OpenJDK 64-Bit Server VM (build 17.0.13+11, mixed mode, sharing)
Home : /usr/lib/jvm/java-17-openjdk
Library : /usr/lib/jvm/java-17-openjdk/lib/server/libjvm.so
Configuration : system
I tried creating a java.opts file as suggested here. It did not make a difference.
I tried uninstalling and reinstalling matlab. It did not make a difference.
I had never set a MATLAB_JAVA variable, setting/unsetting it does not make a difference.
Any advice appreciated.

채택된 답변

Grace Kepler
Grace Kepler 2025년 1월 7일

추가 답변 (3개)

Steph Bredenhann
Steph Bredenhann 2024년 12월 15일
I have the same problem, installed Matlab R2024b on Ubuntu 24.04 LTS.

Johannes
Johannes 2025년 1월 2일
Same problem, running macOS 15.1.1. and Matlab R2024b. Java Runtime 11 is installed as per the manual of Matlab. Setting MATLAB_JAVA variable does nothing.
Please advise.

Joonatan
Joonatan 2025년 1월 7일
I'm having the exact same issue. Did any of you find a solution? I have a fresh install of Linux Mint 22 Cinnamon and Matlab R2024b. I tried reinstalling Matlab, same issue. Exact error:
Cannot locate or initialize class com/mathworks/jmi/OpaqueJavaInterface.
java.lang.NoClassDefFoundError: com/mathworks/jmi/OpaqueJavaInterface
Caused by: java.lang.ClassNotFoundException: com.mathworks.jmi.OpaqueJavaInterface
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  댓글 수: 3
Navaneeth
Navaneeth 2025년 2월 20일
Try this
sudo /usr/local/MATLAB/R2024b/bin/glnxa64/registerWithOS.sh
It solved mine(debian), but i don't know how :)
kh
kh 2025년 4월 18일
Navaneeth's advice was helpful. I installed R2024a on ubuntu20.04.
Please try:
sudo /usr/local/MATLAB/R2024b/bin/glnxa64/registerWithOS.sh

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품


릴리스

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by