Trying to use JOGL in Matlab

3 visualizaciones (últimos 30 días)
Felix  Felix Mr (CMP)
Felix Felix Mr (CMP) el 5 de Jul. de 2012
Hi there. I've been trying to get this to work all day and have had no luck...
I have a bit of Java which simply displays a triangle on a black background. It works fine in netbeans.
So in Matlab, I have added the 'libjogl_desktop.jnilib' to the library path, and the 'gluegen-rt.jar' and 'jogl-all.jar' to the dynamic classpath. Every time I try to call the function which should produce the graphics I get either
>> netbeans_jogl.Netbeans_jogl.main
??? Java exception occurred:
at jogamp.common.jvm.JVMUtil.initialize(Native Method)
at jogamp.common.jvm.JVMUtil.<clinit>(
>> netbeans_jogl.Netbeans_jogl.main()
??? Java exception occurred:
java.lang.NoClassDefFoundError: Could not initialize class
Like I said I have been trying to get this to work for about 8 hours now, and am really not sure what I'm doing wrong. Any help greatly appreciated.

Respuesta aceptada

Malcolm Lidierth
Malcolm Lidierth el 7 de Jul. de 2012
Editada: Malcolm Lidierth el 7 de Jul. de 2012
MATLAB ships with JOGL 1.1.1 on the static javaclasspath. I'm rusty, but recollect is JOGL2. To use that, you need to replace JOGL1 in classpath.txt and update the shared libraries in your matlabroot/bin/$arch folder. N.B. I have no idea whether that will break any MATLAB code using JOGL1.
It works with jzy3d 0.8 or 0.9 but for 0.9 you need to replace the MATLAB-shipped JOGL version as above.
Added: The Netbeans plugin looks still to be 1.1.1 so I must be wrong on GLProfile bit but the rest is OK. Use plain JOGL - not a netbeans plugin from MATLAB (I have not checked recently but MATLAB did not like Netbeans "wrapped" jars a few years ago).

Más respuestas (0)


Community Treasure Hunt

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

Start Hunting!

Translated by