[jzy3d] JZ3D / JOGL on Mac OSX 10.6

238 views
Skip to first unread message

Jason Zaugg

unread,
May 22, 2010, 2:41:03 AM5/22/10
to Jzy3d
Has anyone got JZY3D working on Mac OS X 10.6?

I tried the following. The same app works on Windows XP.

-jason


~: ls -l target/native/
total 4624
-rw-r--r-- 1 jason staff 20480 Jul 3 2007 gluegen-rt.dll
-rw-r--r-- 1 jason staff 315392 Oct 19 2007 jogl.dll
-rw-r--r-- 1 jason staff 20480 Oct 19 2007 jogl_awt.dll
-rw-r--r-- 1 jason staff 114688 Oct 19 2007 jogl_cg.dll
-rw-r--r-- 1 jason staff 29812 Jul 3 2007 libgluegen-rt.jnilib
-rw-r--r-- 1 jason staff 1518320 Oct 19 2007 libjogl.jnilib
-rw-r--r-- 1 jason staff 34828 Oct 19 2007 libjogl_awt.jnilib
-rw-r--r-- 1 jason staff 307116 Oct 19 2007 libjogl_cg.jnilib

~: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/
bin/java -Djava.library.path=target/native -classpath=... MyApp

Exception in thread "AWT-EventQueue-0"
java.lang.UnsatisfiedLinkError: /Users/jason/code/analytics/analytics-
math/target/native/libjogl.jnilib: no suitable image found. Did
find: /Users/jason/code/analytics/analytics-math/target/native/
libjogl.jnilib: no matching architecture in universal wrapper
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1861)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1778)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1045)
at
com.sun.opengl.impl.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:
189)
at com.sun.opengl.impl.NativeLibLoader.access
$000(NativeLibLoader.java:49)
at com.sun.opengl.impl.NativeLibLoader
$DefaultAction.loadLibrary(NativeLibLoader.java:80)
at
com.sun.opengl.impl.NativeLibLoader.loadLibrary(NativeLibLoader.java:
103)
at com.sun.opengl.impl.NativeLibLoader.access
$200(NativeLibLoader.java:49)
at com.sun.opengl.impl.NativeLibLoader$1.run(NativeLibLoader.java:
111)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.opengl.impl.NativeLibLoader.loadCore(NativeLibLoader.java:
109)
at
com.sun.opengl.impl.macosx.MacOSXGLDrawableFactory.<clinit>(MacOSXGLDrawableFactory.java:
53)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at
javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.java:
108)
at javax.media.opengl.GLJPanel.initialize(GLJPanel.java:900)
at javax.media.opengl.GLJPanel.paintComponent(GLJPanel.java:488)
[snip]
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError:
Could not initialize class
com.sun.opengl.impl.macosx.MacOSXGLDrawableFactory
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at
javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.java:
108)
at javax.media.opengl.GLJPanel.initialize(GLJPanel.java:900)
at javax.media.opengl.GLJPanel.paintComponent(GLJPanel.java:488)
[snip]

I tried using a nightly build of JOGL 2.0, which should support 64bit
Snow Leapord: (https://jogl.dev.java.net/issues/show_bug.cgi?id=336)

~: ls /Users/jason/usr/jogl-2.0-macosx-universal/lib/*jnilib
/Users/jason/usr/jogl-2.0-macosx-universal/lib/libgluegen-rt.jnilib
/Users/jason/usr/jogl-2.0-macosx-universal/lib/libjogl_cg.jnilib
/Users/jason/usr/jogl-2.0-macosx-universal/lib/libjogl_es1.jnilib
/Users/jason/usr/jogl-2.0-macosx-universal/lib/libjogl_es2.jnilib
/Users/jason/usr/jogl-2.0-macosx-universal/lib/libjogl_gl2.jnilib
/Users/jason/usr/jogl-2.0-macosx-universal/lib/libjogl_gl2es12.jnilib
/Users/jason/usr/jogl-2.0-macosx-universal/lib/
libnativewindow_awt.jnilib
/Users/jason/usr/jogl-2.0-macosx-universal/lib/
libnativewindow_jvm.jnilib
/Users/jason/usr/jogl-2.0-macosx-universal/lib/libnewt.jnilib

~: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/
bin/java -Djava.library.path=/Users/jason/usr/jogl-2.0-macosx-
universal/lib -classpath=... MyApp

Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError:
no jogl in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1792)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1045)
at
com.sun.opengl.impl.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:
189)
at com.sun.opengl.impl.NativeLibLoader.access
$000(NativeLibLoader.java:49)
at com.sun.opengl.impl.NativeLibLoader
$DefaultAction.loadLibrary(NativeLibLoader.java:80)
at
com.sun.opengl.impl.NativeLibLoader.loadLibrary(NativeLibLoader.java:
103)
at com.sun.opengl.impl.NativeLibLoader.access
$200(NativeLibLoader.java:49)
at com.sun.opengl.impl.NativeLibLoader$1.run(NativeLibLoader.java:
111)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.opengl.impl.NativeLibLoader.loadCore(NativeLibLoader.java:
109)
at
com.sun.opengl.impl.macosx.MacOSXGLDrawableFactory.<clinit>(MacOSXGLDrawableFactory.java:
53)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at
javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.java:
108)
at javax.media.opengl.GLJPanel.initialize(GLJPanel.java:900)
at javax.media.opengl.GLJPanel.paintComponent(GLJPanel.java:488)
at javax.swing.JComponent.paint(JComponent.java:1017)
[snip]
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError:
Could not initialize class
com.sun.opengl.impl.macosx.MacOSXGLDrawableFactory
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)

Jason Zaugg

unread,
May 22, 2010, 2:43:19 AM5/22/10
to Jzy3d
I should add:

~: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/
java -versionjava version "1.6.0_17"Java(TM) SE Runtime Environment
(build 1.6.0_17-b04-248)Java HotSpot(TM) 64-Bit Server VM (build 14.3-
b01-101, mixed mode)

~: uname -aDarwin Jason-Zauggs-MacBook-Pro.local 10.3.1 Darwin Kernel
Version 10.3.1: Mon Mar 22 15:13:15 PDT 2010; root:xnu-1504.3.52~1/
RELEASE_I386 i386

Jason Zaugg

unread,
May 22, 2010, 11:09:27 AM5/22/10
to jz...@googlegroups.com
Forwarding back to group.

I'm not that familiar with troubleshooting JNI problems on Mac. The
bug report on JOGL suggests that its a 64bit issue and would be solved
in the new version, but this is not API compatible, so JZY3d would
need a few changes.

I tried to check out your sources and build, but I get:

~/code/jzy3d[master]: ant
Buildfile: /Users/jason/code/jzy3d/build.xml

clean:
[delete] Deleting directory /Users/jason/code/jzy3d/build/classes

compile.api:
[mkdir] Created dir: /Users/jason/code/jzy3d/build/classes
[javac] /Users/jason/code/jzy3d/build.xml:37: warning:
'includeantruntime' was not set, defaulting to
build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 207 source files to /Users/jason/code/jzy3d/build/classes
[javac] /Users/jason/code/jzy3d/src/api/net/masagroup/jzy3d/plot3d/rendering/view/View.java:35:
package net.masagroup.jzy3d.trials.misc does not exist
[javac] import net.masagroup.jzy3d.trials.misc.Parallelepiped;


-jason


---------- Forwarded message ----------
From: Martin <martin.p...@gmail.com>
Date: Sat, May 22, 2010 at 4:58 PM
Subject: Re: JZ3D / JOGL on Mac OSX 10.6
To: Jason Zaugg <jza...@gmail.com>


Hi,

I think it's more a question of having binaries on the current path
than a platform problem. java.lang.UnsatisfiedLinkError means java
can't find them, so either run your program in [jzy]/bin/[platform],
or link your project with the binaries as explained there (http://
code.google.com/p/jzy3d/w/edit/Support).

In case it's a platform issue, I'm not using Mac so I won't help you
that much. You may however read posts concerning problems related to
mac:
http://groups.google.com/group/jzy3d/browse_thread/thread/42ca430de862defa/99c0490a64c90013#99c0490a64c90013

Maybe Massimiliano will have some hints for you, since he already
tried jzy on several macintosh computers. He also added binaries for
mac (see /bin).

As mentionned in this post (http://groups.google.com/group/jzy3d/
browse_thread/thread/65abc247e46bcf16#), there is a repository where
you can find compiled binaries for several platforms. Jzy3d is not
ported yet to Jogl2, so you should try to use jogl-1.1.1 rc3

Hope this helps,

Martin

Martin Pernollet

unread,
May 22, 2010, 11:24:23 AM5/22/10
to jz...@googlegroups.com
You are right. I just commited a fix on the build file, so just update it. 

2010/5/22 Jason Zaugg <jza...@gmail.com>

Jason Zaugg

unread,
May 23, 2010, 6:37:29 AM5/23/10
to jz...@googlegroups.com
Thanks, I can build it now. I tried updating to version 1.2.0 of JOGL,
but the API [1] has changed a bit too much for me to port JZY3d code,
seeing as I don't know all that much about OpenGL.

-jason

[1] http://jogamp.org/deployment/jogl-next/javadoc_public/

Jason Zaugg

unread,
May 23, 2010, 7:22:35 AM5/23/10
to jz...@googlegroups.com
Forwarding back to list for the record...


---------- Forwarded message ----------
From: Jason Zaugg <jza...@gmail.com>
Date: Sun, May 23, 2010 at 1:22 PM
Subject: Re: Fwd: JZ3D / JOGL on Mac OSX 10.6
To: Martin <martin.p...@gmail.com>


Yes, i included the correct native libs in java.library.path. They
came from here [1].  This version does not seem to work on Mac OS X
10.6 64bit. The JVM finds the native lib, but issues the error:

 java.lang.UnsatisfiedLinkError: /Users/jason/code/analytics/analytics-
math/target/native/libjogl.jnilib:  no suitable image found.  Did
find:  /Users/jason/code/analytics/analytics-math/target/native/
libjogl.jnilib: no matching architecture in universal wrapper

I believe that this error is the referred to in this JOGL issue [2].
In February they said:

>Support has been added to the JOGL and GlueGen workspaces.
>It is necessary to specify "macosx64fat" in jogl.properties and
>gluegen.properties when building. We need to get a new Mac
>capable of running 64-bit Leopard in order to start building
>universal binaries with 64-bit x86 code.

They closed the bug in March, saying it was fixed in the nightly
builds. I've tried with jogl-1.1.0-macosx-universal build on 23 April
[3], but this gives the same error.

I then tried to use the 1.2.0 version (based on JSR-231), after
porting JZY3d to the new API. This turned out to be non-trivial, so I
gave up. Probably with a careful read of [4] it could be done.

I'm going to try to build 1.1.0 from source next.

-jason

[1] http://download.java.net/maven/2/net/java/dev/jogl/jogl-macosx-universal/1.1.1-rc6/jogl-macosx-universal-1.1.1-rc6.jar
[2] https://jogl.dev.java.net/issues/show_bug.cgi?id=336
[3] http://download.java.net/media/jogl/builds/archive/jsr-231-1.1.0/
[4] http://www.javagaming.org/index.php/topic,12817.0.html

On Sun, May 23, 2010 at 12:46 PM, Martin <martin.p...@gmail.com> wrote:
> You should not try any other version than jogl 1.1.1 rc3
> I guess when you keep this version you still have the error message
> you sent in your first mail?
> Did you check that libjogl.jnilib and all other libraries are really
> in the path?
> martin

Martin Pernollet

unread,
May 23, 2010, 7:44:33 AM5/23/10
to jz...@googlegroups.com
Many thanks for this very clear and structured response.
If you want to test ability to run a specific version of jogl on your computer without refactoring Jzy3d, I suggest you use all provided Open Gl red book examples (in src/glredbook) that are often not more than 200 lines of sample codes probably easier to refactor.

Let us know your success when running other version of jogl on your platform. I fear I will really have to port jzy to jogl2 one day, because other unsolved issues might be solved by a more up to date version of jogl. I'm mostly speaking about problems on Win7[1], problems related to the poor overlay results [2], or to blinking problems appearing on some specific java minor versions [3].
Martin


2010/5/23 Jason Zaugg <jza...@gmail.com>

Jason Zaugg

unread,
May 23, 2010, 11:29:03 AM5/23/10
to jz...@googlegroups.com
Hi Martin,

The version numbering scheme of JOGL is a bit confusing, and I
couldn't find a set of release notes to tell me which one was
appropriate.

But despite this, I found a version that works: 1.1.1a.

BTW, I'm using the library to help visualize surface interpolation
algorithms for a financial application. I was really glad to find
something easy to integrate that gives us some attractive 3D output!

Is there a way to all zoom in and out? Currently, the mouse-wheel just
scales the Z-Axis.

regards,

-jason


~/usr: curl http://download.java.net/media/jogl/builds/archive/jsr-231-1.1.1a/jogl-1.1.1a-macosx-universal.zip
> jogl.zip
~/usr: unzip jogl.zip
Archive: jogl.zip
inflating: jogl-1.1.1-macosx-universal/CHANGELOG.txt
inflating: jogl-1.1.1-macosx-universal/COPYRIGHT.txt
inflating: jogl-1.1.1-macosx-universal/LICENSE-JOGL-1.1.1.txt
inflating: jogl-1.1.1-macosx-universal/README.txt
inflating: jogl-1.1.1-macosx-universal/Userguide.html
inflating: jogl-1.1.1-macosx-universal/lib/gluegen-rt.jar
inflating: jogl-1.1.1-macosx-universal/lib/jogl.jar
inflating: jogl-1.1.1-macosx-universal/lib/libgluegen-rt.jnilib
inflating: jogl-1.1.1-macosx-universal/lib/libjogl.jnilib
inflating: jogl-1.1.1-macosx-universal/lib/libjogl_awt.jnilib
inflating: jogl-1.1.1-macosx-universal/lib/libjogl_cg.jnilib

~/usr: file jogl-1.1.1-macosx-universal/lib/libjogl.jnilib
jogl-1.1.1-macosx-universal/lib/libjogl.jnilib: Mach-O universal
binary with 3 architectures
jogl-1.1.1-macosx-universal/lib/libjogl.jnilib (for architecture
ppc7400): Mach-O dynamically linked shared library ppc
jogl-1.1.1-macosx-universal/lib/libjogl.jnilib (for architecture
i386): Mach-O dynamically linked shared library i386
jogl-1.1.1-macosx-universal/lib/libjogl.jnilib (for architecture
x86_64): Mach-O 64-bit dynamically linked shared library x86_64

Martin Pernollet

unread,
May 23, 2010, 12:21:50 PM5/23/10
to jz...@googlegroups.com


2010/5/23 Jason Zaugg <jza...@gmail.com>

Hi Martin,

The version numbering scheme of JOGL is a bit confusing, and I
couldn't find a set of release notes to tell me which one was
appropriate.

But despite this, I found a version that works: 1.1.1a.

Shall I ask you where you found the version? Can I also ask you to commit your working binaries (I can grant you an access for that).

 

BTW, I'm using the library to help visualize surface interpolation
algorithms for a financial application. I was really glad to find
something easy to integrate that gives us some attractive 3D output!

Great, that helped! I would be glad to know more about how people use jzy, so if you one day publish a documentation explaining what you do with jzy, do not hesitate to send some links!
 

Is there a way to all zoom in and out? Currently, the mouse-wheel just
scales the Z-Axis.

You should do two things: 
1) modify how the mouse controls the view (see the ChartMouseController class): its mouseWheelMoved implementation calls View.zoom(...) with a zooming factor
2) override the View.zoom() that actually performs zoom. It uses Chart.setScale that only works with axis z. It could be indeed nice to have a 3d scale, or scale selection in future version, but you can do quite the same with calls to setBoundManual(..) and updateBounds(). 

To rapidly inject your view implementation as the default chart view, you can instanciate your chart this way:

Chart chart = new Chart(){
protected ChartScene initializeScene(boolean graphsort){
return new ChartScene(graphsort){
protected ChartView initializeChartView(Scene scene, ICanvas canvas, Quality quality){
return new MyViewImplementation(scene, canvas, quality);
}
};
}
}

Cheers,
Martin

Jason Zaugg

unread,
May 23, 2010, 12:32:44 PM5/23/10
to jz...@googlegroups.com
The binaries of 1.1.1a are here:

http://download.java.net/media/jogl/builds/archive/jsr-231-1.1.1a/

-jason
Reply all
Reply to author
Forward
0 new messages