Login  Register

Implementing JOGL

Posted by glennp on Mar 25, 2012; 4:59pm
URL: https://forum.jogamp.org/Implementing-JOGL-tp3855954.html

I am in the process of developing a desktop mapping application using GeoTools.  It will only run on Windows.  I need to use hardware acceleration in order to make this application work properly.  In researching Open GL it seems that the Java world relies on JOGL to accomplish this.

I am developing on Win 7 32-bit so I downloaded the i586 version.  Now I am trying to run the test_dbg bat file.  I do get a window briefly displayed.  But the log file contains all sorts of errors.  Obviously I do not have the run time environment set up properly.  I tried going with the JOGL Userguide, but it does say it is out of date.  I have tried searching for more up to date instructions but can't find anything.

Could someone please outline the proper installation for the latest version of JOGL?

After it first failed I did make some modifications to the bat file based on what I saw in the Userguide.  Here is what I am trying to run:

set path=D:\java\jogamp-windows-i586\lib;%PATH%
set BLD_DIR=D:\java\jogamp-windows-i586\jar

set CP_ALL=.;%BLD_DIR%\gluegen-rt.jar;%BLD_DIR%\jogl.all.jar;%BLD_DIR%
echo CP_ALL %CP_ALL%

set D_ARGS="-Djogamp.debug=all" "-Dnativewindow.debug=all" "-Djogl.debug=all" "-Dnewt.debug=all"
set X_ARGS="-Dsun.java2d.noddraw=true" "-Dsun.awt.noerasebackground=true"

java -classpath %CP_ALL% %X_ARGS% %D_ARGS% com.jogamp.newt.opengl.GLWindow >> test_dbg.log 2>&1

I do get a lot of output.  Evidently it is verifying that it can access all the proper jar and DLL files.

The first error I find in the log is:

JNILibLoaderBase: loaded gluegen-rt
java.lang.Exception: JVMUtil.initSingleton() .. initialized main
	at jogamp.common.jvm.JVMUtil.<clinit>(JVMUtil.java:62)
	at com.jogamp.common.os.Platform.<clinit>(Platform.java:215)
	at com.jogamp.common.util.VersionUtil.getPlatformInfo(VersionUtil.java:54)
	at com.jogamp.common.util.VersionUtil.getPlatformInfo(VersionUtil.java:82)
	at com.jogamp.newt.opengl.GLWindow.main(GLWindow.java:909)

Then I get:

GLProfile.initSingleton(firstUIActionOnProcess: false) - thread main
java.lang.Exception: Stack trace
	at java.lang.Thread.dumpStack(Thread.java:1249)
	at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:117)
	at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:151)
	at javax.media.opengl.GLProfile.getProfileMap(GLProfile.java:1688)
	at javax.media.opengl.GLProfile.get(GLProfile.java:652)
	at javax.media.opengl.GLProfile.getDefault(GLProfile.java:478)
	at javax.media.opengl.GLProfile.getDefault(GLProfile.java:486)
	at com.jogamp.newt.opengl.GLWindow.main(GLWindow.java:913)

And  little later I get:

java.lang.Throwable: main - Info: NativeWindowFactory.<init>
	at javax.media.nativewindow.NativeWindowFactory.<clinit>(NativeWindowFactory.java:138)
	at javax.media.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1214)
	at javax.media.opengl.GLProfile.access$000(GLProfile.java:75)
	at javax.media.opengl.GLProfile$1.run(GLProfile.java:133)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:122)
	at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:151)
	at javax.media.opengl.GLProfile.getProfileMap(GLProfile.java:1688)
	at javax.media.opengl.GLProfile.get(GLProfile.java:652)
	at javax.media.opengl.GLProfile.getDefault(GLProfile.java:478)
	at javax.media.opengl.GLProfile.getDefault(GLProfile.java:486)
	at com.jogamp.newt.opengl.GLWindow.main(GLWindow.java:913)

And on down the log I find:

GLDrawableFactory.static - Native OS Factory for: Windows: jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory
main - DynamicLibraryBundle.init start with: jogamp.opengl.windows.wgl.WindowsWGLDynamicLibraryBundleInfo
java.lang.Exception: Stack trace
	at java.lang.Thread.dumpStack(Thread.java:1249)
	at com.jogamp.common.os.DynamicLibraryBundle.<init>(DynamicLibraryBundle.java:82)
	at jogamp.opengl.GLDynamicLookupHelper.<init>(GLDynamicLookupHelper.java:36)
	at jogamp.opengl.DesktopGLDynamicLookupHelper.<init>(DesktopGLDynamicLookupHelper.java:37)
	at jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory.<init>(WindowsWGLDrawableFactory.java:93)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:166)
	at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:188)
	at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:208)
	at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:230)
	at javax.media.opengl.GLDrawableFactory.initSingletonImpl(GLDrawableFactory.java:150)
	at javax.media.opengl.GLDrawableFactory.initSingleton(GLDrawableFactory.java:115)
	at javax.media.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1244)
	at javax.media.opengl.GLProfile.access$000(GLProfile.java:75)
	at javax.media.opengl.GLProfile$1.run(GLProfile.java:133)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:122)
	at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:151)
	at javax.media.opengl.GLProfile.getProfileMap(GLProfile.java:1688)
	at javax.media.opengl.GLProfile.get(GLProfile.java:652)
	at javax.media.opengl.GLProfile.getDefault(GLProfile.java:478)
	at javax.media.opengl.GLProfile.getDefault(GLProfile.java:486)
	at com.jogamp.newt.opengl.GLWindow.main(GLWindow.java:913)

And then I start getting X11 errors.  This I don't understand since I am running on Windows.  I thought X11 is for Linux.  Here is the start of the errors:

JNILibLoaderBase: loadLibraryInternal(nativewindow_x11) -> TempJarCache not mapped
JNILibLoaderBase: loadLibraryInternal(nativewindow_x11) -> System.loadLibrary(nativewindow_x11)
java.lang.UnsatisfiedLinkError: no nativewindow_x11 in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
	at java.lang.Runtime.loadLibrary0(Runtime.java:823)
	at java.lang.System.loadLibrary(System.java:1028)
	at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:318)
	at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:55)
	at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:85)
	at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:215)
	at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrary(DynamicLibraryBundle.java:365)
	at com.jogamp.common.os.DynamicLibraryBundle.loadLibraries(DynamicLibraryBundle.java:274)
	at com.jogamp.common.os.DynamicLibraryBundle.<init>(DynamicLibraryBundle.java:87)
	at jogamp.opengl.GLDynamicLookupHelper.<init>(GLDynamicLookupHelper.java:36)
	at jogamp.opengl.DesktopGLDynamicLookupHelper.<init>(DesktopGLDynamicLookupHelper.java:37)
	at jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory.<init>(WindowsWGLDrawableFactory.java:93)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:166)
	at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:188)
	at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:208)
	at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:230)
	at javax.media.opengl.GLDrawableFactory.initSingletonImpl(GLDrawableFactory.java:150)
	at javax.media.opengl.GLDrawableFactory.initSingleton(GLDrawableFactory.java:115)
	at javax.media.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1244)
	at javax.media.opengl.GLProfile.access$000(GLProfile.java:75)
	at javax.media.opengl.GLProfile$1.run(GLProfile.java:133)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:122)
	at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:151)
	at javax.media.opengl.GLProfile.getProfileMap(GLProfile.java:1688)
	at javax.media.opengl.GLProfile.get(GLProfile.java:652)
	at javax.media.opengl.GLProfile.getDefault(GLProfile.java:478)
	at javax.media.opengl.GLProfile.getDefault(GLProfile.java:486)
	at com.jogamp.newt.opengl.GLWindow.main(GLWindow.java:913)
Info: Could not load JNI/Glue library: nativewindow_x11

And then I start getting a huge list of failed lookups.  Here is just a small list:

Lookup-Native: <glMapBuffer> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferARB> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferGL2> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferOES> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferKHR> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferOML> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBuffer3DFX> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferAMD> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferANGLE> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferARM> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferAPPLE> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferATI> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferEXT> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferHI> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferHP> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferIBM> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferIMG> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferMESA> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferMESAX> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferNV> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferQCOM> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]

I'll stop here.  I don't know what to do to fix this.  Could someone please give me some instructions on what is wrong and how I go about fixing it?

I do greatly appreciate any feedback to help get me past this!!