Java-related error on start-up and when attempting to generate plots in Matlab
14 views (last 30 days)
Show older comments
Pooyan Kheirkhah
on 2 Dec 2020
Commented: Rachid Belaroussi
on 25 Mar 2021
I have recently installed R2020-b, but upon launching Matlab, I get the following error message:
Exception in thread "Startup Class Loader": java.lang.NoClassDefFoundError: com/jogamp/common/os/Platform
at com.jogamp.opengl.GLProfile.<clinit>(GLProfile.java:146)
at com.mathworks.hg.peer.JOGLInitializer.initializeJOGL(JOGLInitializer.java:47)
at com.mathworks.hg.peer.JOGLInitializer.<clinit>(JOGLInitializer.java:25)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.mathworks.mde.desk.StartupClassLoader.loadClass(StartupClassLoader.java:258)
at com.mathworks.mde.desk.StartupClassLoader.access$1000(StartupClassLoader.java:25)
at com.mathworks.mde.desk.StartupClassLoader$2.run(StartupClassLoader.java:245)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: com.jogamp.common.os.Platform
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)
... 9 more
Also, when I try to run the "plot" command, I get the following error which seems to be related to some Java files:
Exception in thread "AWT-EventQueue-0": java.lang.NoClassDefFoundError: com/jogamp/common/type/WriteCloneable
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
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)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
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)
at com.mathworks.hg.peer.GraphicsPeerWithComponent.createJOGLCanvas(GraphicsPeerWithComponent.java:19)
at com.mathworks.hg.peer.GraphicsPeer.doCreateCanvas(GraphicsPeer.java:119)
at com.mathworks.hg.peer.GraphicsPeer.access$100(GraphicsPeer.java:16)
at com.mathworks.hg.peer.GraphicsPeer$1.run(GraphicsPeer.java:174)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.ClassNotFoundException: com.jogamp.common.type.WriteCloneable
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)
... 42 more
I tried clean-copy re-instrallation several times, but that doesen't fix the issue either.
Does anyone know how I can get around this problem?
Thanks.
1 Comment
Accepted Answer
Clifford Lang
on 3 Dec 2020
Several of our users were seeing a similar problem in our organization in the last few days. Our issues seemed to be our antivirus (Cisco Amp) blocking a specific JAR file. We've added the file to Amp's whitelist and are testing now.
One of our users reported he "...launched Matlab from the command window with the –noopengl flag and it works that way (though without OpenGL graphics, but still plots)."
10 Comments
Rachid Belaroussi
on 25 Mar 2021
"matlab –noopengl" worked for me on MatlabR2021 (previously crashing, during my first install and first use of the product). I can save figures.
More Answers (5)
Craig Janssen
on 11 Dec 2020
I am the AMP administrator for our company. We have put this exclusion - C:\Program Files\MATLAB\ as a test. I am waiting on the Matlab users to test to see if it fixes the issue.
I will update when I get feedback from users on if it works or not.
-Craig
2 Comments
Larry Stern
on 11 Dec 2020
Craig. They will need to restore glugen-rt.jar before it will work. As best I can tell amp deletes it when it accessed. I find no files in quarantine. Adding an exclusion is the first step. But not the only step to get back to a working MATLAB.
Craig Janssen
on 16 Dec 2020
Edited: Craig Janssen
on 16 Dec 2020
Larry,
It is a work in progress agreed. But some of our users are seeing the problem and others are not. So it is hard to know exactly what is going from an AMP side. I am looking over your updates for more suggestions.
Thanks,
Craig
Larry Stern
on 11 Dec 2020
Edited: Larry Stern
on 11 Dec 2020
With Cisco amp end users can not add an exclusion. The amp administrator has to do it. Our group excluded the file glugen-rt.jar. I can send the exact string latter today. As best I can tell amp will delete the file when accessed. Looking in the quarantine list nothing is there. After amp policy sync confirms the exclusion is in place you can then move a copy of glugen-rt.jar back to its correct location. Or do a full uninstall reinstall. After that MATLAB works correctly. I’ve had some versions of MATLAB not want to fully uninstall so you need to look and either do some pretty hard windows tricks to get the file to delete or just rename the folder before you do the new install. Or that will fail on you after you waited an hour for it to complete.
Note that glugen-rt.jar goes in:
C:\Program Files\MATLAB\R20XXx\java\jarext
Where R20XXx dentoes your specific version of Matlab such as R2020a etc.
The location would differ if you installed Matlab to a location differtent from the default.
0 Comments
Larry Stern
on 11 Dec 2020
Also as an FYI. I opened a case with MATLAB technical support on this topic. I have communicated my findings to them. They told me that they escalated it to the engineering team and they, in turn, will contact the correct group at Cisco in order to resolve this for the global community.
0 Comments
Larry Stern
on 11 Dec 2020
I looked to see what exclusion our AMP Admin group used. It was:
glugen\-rt.*\.jar
I have tried restoring glugen-rt.jar to at least 4 different versions of Matlab and restoring this one file seems to work so far.
It migth be better to only excldue this one file vs all of the MATLAB directory structure.
4 Comments
Craig Janssen
on 22 Dec 2020
Larry,
We pretty much followed the steps listed above and got the issue resolved. Getting a copy of the jar file was possible from AMP console -> File repository. AMP administrator can request a copy get moved to there and then download it.
For a stop gap measure, it is working nicely.
Thanks for the starting point on how to get the issue resolved.
Craig
Larry Stern
on 22 Dec 2020
Sounds good Craig. Im not an amp administrator so I didn’t get that choice. So for anyone without access to the amp repository, they can do either a reinstall or get the file from a machine that didn’t have amp installed. Also FYI there is still no word on whether Cisco has been informed at all about any of this. Mathworks seems reluctant to do so. I opened a ticket at my university on this but got no response. I can’t open a ticket with Cisco since I’m not an amp license holder. Maybe you can try on your end.
Larry Stern
on 11 Dec 2020
Edited: Larry Stern
on 11 Dec 2020
Note that I have no way of knowing for certain if the glugen-rt.jar file is, in fact, an infected file. Mathworks seems to be using the same file for years. So far, no user has reported any virus behaviour on any machine that has it. My suspicion is that it is a false postive by AMP. Potentially, they can fix it by using a longer signature that eliminates glugen-rt.jar from being flagged while still catching files that have whatever content they are actually looking for.
2 Comments
Craig Janssen
on 16 Dec 2020
Based on what the AMP console and Talos is showing it appears to be a false positive. AMP can be very particular on certain types of files. I figured out that I can get a copy of the jar file in question from AMP's file repo. We are trying that to see if we can avoid a full re-install.
From Talos -
SHA256
FILE SIZE 328947 bytes
SAMPLE TYPE Zip archive data, at least v1.0 to extract
AMP DETECTION NAME *Detection not found.*Limited to SHA256 lookup
ASSOCIATED DOMAINS FOR THIS HASH
Domains not available
DETECTION ALIASES
No aliases detected.
Larry Stern
on 16 Dec 2020
I'm operating under the assumption that it is a false positive, and AMP modifying their signature file so that the string is a little longer should fix it.
I opened a ticket with Mathworks on this issue.
Their engineering team is suppsoed to be contacting the folks at Cisco and hopefully come up with a solution that fixes this issue for the global community.
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!