java.lang.NoClassDefFoundError: javax/media/opengl/GLJPanel

732 views
Skip to first unread message

kaamil jasani

unread,
Mar 31, 2016, 8:04:10 PM3/31/16
to Jzy3d
Hi,

I am trying to use the API to plot a 3d scatter chart.

This is the code I am using:

Coord3d[] coords = new Coord3d[32*32*32];
org.jzy3d.colors.Color[] colors = new org.jzy3d.colors.Color[32*32*32];
for(int i = 0; i < 32*32*32; i++){
    int point = LUT[i%32][(i/32)%32][i/(32*32)];
    Color color = new Color(point);
    coords[i] = new Coord3d(color.getRGBColorComponents(null));
    colors[i] = new org.jzy3d.colors.Color((i%32)/31f, ((i/32)%32)/31f, (i/(32*32))/31f, 0.25f);
}
                    
Scatter scatter = new Scatter(coords, colors);
Chart chart = new Chart(Quality.Nicest, "swing");
graphPanel.setLayout(new BorderLayout());
graphPanel.add((JComponent)chart.getCanvas());

If I am using the latest version of jzy3d and the dependencies available from the website I get an error that says: java.lang.NoClassDefFoundError: javax/media/opengl/GLCapabilitiesImmutable

One of the other topics suggested downgrading to the 0.8.x version. After I did (and got the respective dependancies) I get the following error:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: javax/media/opengl/GLJPanel
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:455)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:367)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.jzy3d.chart.Chart.initializeCanvas(Chart.java:67)
at org.jzy3d.chart.Chart.<init>(Chart.java:56)
at main.Main.jButton1ActionPerformed(Main.java:300)
at main.Main.access$200(Main.java:31)
at main.Main$3.actionPerformed(Main.java:87)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2346)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6525)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6290)
at java.awt.Container.processEvent(Container.java:2234)
at java.awt.Component.dispatchEventImpl(Component.java:4881)
at java.awt.Container.dispatchEventImpl(Container.java:2292)
at java.awt.Component.dispatchEvent(Component.java:4703)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4533)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462)
at java.awt.Container.dispatchEventImpl(Container.java:2278)
at java.awt.Window.dispatchEventImpl(Window.java:2739)
at java.awt.Component.dispatchEvent(Component.java:4703)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:746)
at java.awt.EventQueue.access$400(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:697)
at java.awt.EventQueue$3.run(EventQueue.java:691)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:719)
at java.awt.EventQueue$4.run(EventQueue.java:717)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:716)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
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: javax.media.opengl.GLJPanel
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 53 more

I have JOGL included in the path, so I don't understand why this is happening. Any help would be appreciated.

Martin Pernollet

unread,
Apr 1, 2016, 1:53:13 AM4/1/16
to Jzy3d
Hi,

com.jogamp.opengl.awt.GLJPanel is part of jogl 2.3.2 used by jzy3d 1.0.0

javax/media/opengl/GLJPanel is part of jogl < 2.3 and used by jzy3d < 1.0.0

Ensure you have both 1.0.0 and jogl 2.3.2 in your classpath.



--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "Jzy3d".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse jzy3d+un...@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

kaamil jasani

unread,
Apr 1, 2016, 9:14:48 AM4/1/16
to Jzy3d
I had tried this before, but it didn't seem to work... It's working now though, thanks :D
Reply all
Reply to author
Forward
0 new messages