Error with gluegen-rt jar

63 views
Skip to first unread message

Deepak P

unread,
Feb 21, 2013, 1:33:07 AM2/21/13
to jz...@googlegroups.com
Pretty new to JZY3D plots. Some help needed to fix the error

When i am try to run a small example using a main method as shown below it works perfectly fine


public static void main(String[] args) {
       
        // Define a function to plot
        Mapper mapper = new Mapper() {
            public double f(double x, double y) {
                return /*10 * */Math.sin(x / 10) /** Math.cos(y / 20) * x*/;
            }
        };

        // Define range and precision for the function to plot
        Range range = new Range(-150, 150);
        int steps = 50;

        // Create a surface drawing that function
        Shape surface = Builder.buildOrthonormal(new OrthonormalGrid(range, steps, range, steps), mapper);
        surface.setColorMapper(new ColorMapper(new ColorMapRainbow(), surface.getBounds().getZmin(), surface.getBounds().getZmax(), new Color(1, 1, 1, .5f)));
        surface.setFaceDisplayed(true);
        surface.setWireframeDisplayed(false);
        surface.setWireframeColor(Color.BLACK);

        // Create a chart and add the surface
        Chart chart = new Chart(Quality.Advanced);
        chart.getScene().getGraph().add(surface);
        ChartLauncher.openChart(chart);
    }

But whereas when i use the same piece of code as shown below i get an error

Usage is :

public class JYZ3dPlots {

    public void draw(Frame chartFrame) {
       
        // Define a function to plot
        Mapper mapper = new Mapper() {
            public double f(double x, double y) {
                return /*10 * */Math.sin(x / 10) /** Math.cos(y / 20) * x*/;
            }
        };

        // Define range and precision for the function to plot
        Range range = new Range(-150, 150);
        int steps = 50;

        // Create a surface drawing that function
        Shape surface = Builder.buildOrthonormal(new OrthonormalGrid(range, steps, range, steps), mapper);
        surface.setColorMapper(new ColorMapper(new ColorMapRainbow(), surface.getBounds().getZmin(), surface.getBounds().getZmax(), new Color(1, 1, 1, .5f)));
        surface.setFaceDisplayed(true);
        surface.setWireframeDisplayed(false);
        surface.setWireframeColor(Color.BLACK);
       
   

        // Create a chart and add the surface
        Chart chart = new Chart(Quality.Advanced);
        chart.getScene().getGraph().add(surface);
        ChartLauncher.openChart(chart);
    }

}

then i get the below error


java.lang.UnsatisfiedLinkError: no gluegen-rt in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
    at java.lang.Runtime.loadLibrary0(Runtime.java:845)
    at java.lang.System.loadLibrary(System.java:1084)
    at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:454)
    at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:59)
    at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:90)
    at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:328)
    at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrary(DynamicLibraryBundle.java:390)
    at com.jogamp.common.os.Platform$2.run(Platform.java:249)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.jogamp.common.os.Platform.loadGlueGenRTImpl(Platform.java:231)
    at com.jogamp.common.os.Platform.<clinit>(Platform.java:183)
    at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:99)
    at org.jzy3d.global.Settings.<init>(Settings.java:12)
    at org.jzy3d.global.Settings.getInstance(Settings.java:21)
    at org.jzy3d.chart.Chart.<init>(Chart.java:59)
    at org.jzy3d.chart.Chart.<init>(Chart.java:52)
    at org.eclipse.ui.internal.AbstractPartSelectionTracker$1.run(AbstractPartSelectionTracker.java:119)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.runtime.Platform.run(Platform.java:888)
    at org.eclipse.ui.internal.AbstractPartSelectionTracker.fireSelection(AbstractPartSelectionTracker.java:117)
    at org.eclipse.ui.internal.WindowPartSelectionTracker$1.selectionChanged(WindowPartSelectionTracker.java:38)
    at org.eclipse.ui.internal.AbstractPartSelectionTracker$1.run(AbstractPartSelectionTracker.java:119)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.runtime.Platform.run(Platform.java:888)
    at org.eclipse.ui.internal.AbstractPartSelectionTracker.fireSelection(AbstractPartSelectionTracker.java:117)
    at org.eclipse.ui.internal.PagePartSelectionTracker$1.selectionChanged(PagePartSelectionTracker.java:49)
    at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:164)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
    at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:162)
    at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2188)
    at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1211)
    at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1241)
    at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:239)
    at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:233)
    at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:403)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1386)


It shall be really helpful if some can give me fix this error


Thanks in advance

Regards,
Deepak P

Nils Hoffmann

unread,
Feb 21, 2013, 3:33:31 AM2/21/13
to jz...@googlegroups.com
Hi Deepak,
I doubt that the gluegen error you see comes from the code you posted.

Are you executing the failing code from the same project as the one that works, or do you
use two seperate projects?
If you have two seperate projects, have you added the jogl and gluegen-rt dependencies to your project's compile class path?

Sincerely,
Nils
--
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 plus d'options, visitez le site https://groups.google.com/groups/opt_out .
 
 

Deepak P

unread,
Feb 21, 2013, 4:20:34 AM2/21/13
to jz...@googlegroups.com
Hi Nils,
Thanks for your reply

Yes there are 2 seperate projects in use

And the error did occur as mentioned below

And in each project's buildpath, class path, the jars are present independently.

Have added the below jars

applet-launcher.jar
gluegen-rt-natives-windows-i586.jar
gluegen-rt.jar
gluegen.jar
jogl-all-natives-windows-i586.jar
jogl-all.jar
opencsv-2.1.jar
org.convexhull.jar
org.jzy3d-0.9.jar

Is there any other jars to be added in the class path ?? (OS used is Windows)


Regards,
Deepak P

Nils Hoffmann

unread,
Feb 21, 2013, 4:35:46 AM2/21/13
to jz...@googlegroups.com
Hi Deepak,

Am 21.02.2013 10:20, schrieb Deepak P:
Hi Nils,
Thanks for your reply

Yes there are 2 seperate projects in use

And the error did occur as mentioned below

And in each project's buildpath, class path, the jars are present independently.

Have added the below jars

applet-launcher.jar
gluegen-rt-natives-windows-i586.jar
gluegen-rt.jar
gluegen.jar
jogl-all-natives-windows-i586.jar
jogl-all.jar
opencsv-2.1.jar
org.convexhull.jar
org.jzy3d-0.9.jar

Is there any other jars to be added in the class path ?? (OS used is Windows)

No, that should be sufficient for 32 bit windows. If you use 64 bit windows, you should include
the gluegen-rt-natives-windows-amd64.jar and jogl-all-natives-windows-amd64.jar. You should be able
to include them as well, since jogl will pick the correct ones automatically.

Regards,
Nils

julien....@gmail.com

unread,
May 15, 2013, 5:43:07 AM5/15/13
to jz...@googlegroups.com
You might have to set "exported" to "true" in your .classpath file if you want the classes in JOGL and GlueGen JARs to be visible in other projects.
Reply all
Reply to author
Forward
0 new messages