Login  Register

Re: Jogl/Jogamp on Java 8 building from source

Posted by douglaslyon on Jan 02, 2018; 1:58pm
URL: https://forum.jogamp.org/Jogl-Jogamp-on-Java-9-tp4038012p4038478.html

Great find!
I see:
https://bugs.openjdk.java.net/browse/JDK-8172986
as a webstart work-around.
Allow --add-opens option for JNLP signed all permission apps
Hopes dashed when I saw:
The new option '--add-opens' is not handled in
com.sun.deploy.config.Config, leading to run-time failure when
reflective applications (using XStream, Hibernate, ...) are run
https://bugs.java.com/view_bug.do?bug_id=8173166

<j2se version="1.8+" href="http://java.sun.com/products/autodl/j2se"
initial-heap-size="64m" max-heap-size="384m" java-vm-args="-ea
--add-modules=java.se.ee --add-opens=java.base/java.util=ALL-UNNAMED"/>

I never used add-opens, before...hmm.
    <j2se version="1.8+"
     initial-heap-size="64m"
     max-heap-size="384m"
     java-vm-args="-ea --add-opens=java.base/java.util=ALL-UNNAMED"
     />

On a mac, I get;
CacheEntry[http://show.docjava.com:80/book/cgij/code/jnlp/jogl.jnlp]:
updateAvailable=true,lastModified=Sun Dec 31 08:40:29 EST 2017,length=1420
Java Web Start 12.0.1.0
Using JRE version 9.0.1+11 Java HotSpot(TM) 64-Bit Server VM
JRE expiration date: 2/16/18, 12:00 AM
User home directory = /Users/lyon
----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
m:   print memory usage
o:   trigger logging
p:   reload proxy configuration
q:   hide console
r:   reload policy configuration
s:   dump system and deployment properties
t:   dump thread list
v:   dump thread stack
0-5: set trace level to <n>
----------------------------------------------------
Bug 1004: Caught: class com.jogamp.nativewindow.awt.AppContextInfo
cannot access class sun.awt.AppContext (in module java.desktop) because
module java.desktop does not export sun.awt to unnamed module @39e1d8f9
java.lang.IllegalAccessException: class
com.jogamp.nativewindow.awt.AppContextInfo cannot access class
sun.awt.AppContext (in module java.desktop) because module java.desktop
does not export sun.awt to unnamed module @39e1d8f9
        at
java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Unknown
Source)
        at java.base/java.lang.reflect.AccessibleObject.checkAccess(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at
com.jogamp.nativewindow.awt.AppContextInfo.fetchAppContext(AppContextInfo.java:186)
        at
com.jogamp.nativewindow.awt.AppContextInfo.update(AppContextInfo.java:130)
        at
com.jogamp.nativewindow.awt.AppContextInfo.<init>(AppContextInfo.java:45)
        at com.jogamp.nativewindow.awt.JAWTWindow.<init>(JAWTWindow.java:128)
        at
jogamp.nativewindow.jawt.macosx.MacOSXJAWTWindow.<init>(MacOSXJAWTWindow.java:79)
        at
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source)
        at
java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
        at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
        at
jogamp.nativewindow.NativeWindowFactoryImpl.getAWTNativeWindow(NativeWindowFactoryImpl.java:105)
        at
jogamp.nativewindow.NativeWindowFactoryImpl.getNativeWindowImpl(NativeWindowFactoryImpl.java:66)
        at
com.jogamp.nativewindow.NativeWindowFactory.getNativeWindow(NativeWindowFactory.java:593)
        at
com.jogamp.opengl.awt.GLCanvas.createJAWTDrawableAndContext(GLCanvas.java:712)
        at com.jogamp.opengl.awt.GLCanvas.addNotify(GLCanvas.java:623)
        at java.desktop/java.awt.Container.addNotify(Unknown Source)
        at java.desktop/java.awt.Window.addNotify(Unknown Source)
        at java.desktop/java.awt.Frame.addNotify(Unknown Source)
        at java.desktop/java.awt.Window.show(Unknown Source)
        at java.desktop/java.awt.Component.show(Unknown Source)
        at java.desktop/java.awt.Component.setVisible(Unknown Source)
        at java.desktop/java.awt.Window.setVisible(Unknown Source)
        at j3d.JOGLQuad.main(JOGLQuad.java:96)
        at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
        at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
        at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at jdk.javaws@9.0.1/com.sun.javaws.Launcher.executeApplication(Unknown
Source)
        at jdk.javaws@9.0.1/com.sun.javaws.Launcher.executeMainClass(Unknown
Source)
        at jdk.javaws@9.0.1/com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
        at jdk.javaws@9.0.1/com.sun.javaws.Launcher.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Bug 1004: Caught: class com.jogamp.nativewindow.awt.AppContextInfo
cannot access class sun.awt.AppContext (in module java.desktop) because
module java.desktop does not export sun.awt to unnamed module @39e1d8f9
java.lang.IllegalAccessException: class
com.jogamp.nativewindow.awt.AppContextInfo cannot access class
sun.awt.AppContext (in module java.desktop) because module java.desktop
does not export sun.awt to unnamed module @39e1d8f9
        at
java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Unknown
Source)
        at java.base/java.lang.reflect.AccessibleObject.checkAccess(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at
com.jogamp.nativewindow.awt.AppContextInfo.fetchAppContext(AppContextInfo.java:186)
        at
com.jogamp.nativewindow.awt.AppContextInfo.update(AppContextInfo.java:130)
        at
com.jogamp.nativewindow.awt.AppContextInfo.invokeOnAppContextThread(AppContextInfo.java:102)
        at
com.jogamp.nativewindow.awt.JAWTWindow.attachSurfaceLayer(JAWTWindow.java:491)
        at
jogamp.opengl.macosx.cgl.MacOSXCGLContext$NSOpenGLImpl$AttachGLLayerCmd.run(MacOSXCGLContext.java:764)
        at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:125)

but it runs...so this is feeling a little broken (but hey, its making
pictures!).

On windows jdk9...with jws, no joy.

Here are the DLLS for amd64 (broken out, to be explicit):
<resources os="Windows" arch="amd64">
<nativelib href="libs/jogl/natives/windows-amd64/gluegen-rt.dll.jar"
download="eager"/>
<nativelib href="libs/jogl/natives/windows-amd64/joal.dll.jar"
download="eager"/>
<nativelib href="libs/jogl/natives/windows-amd64/jocl.dll.jar"
download="eager"/>
<nativelib href="libs/jogl/natives/windows-amd64/jogl_desktop.dll.jar"
download="eager"/>
<nativelib href="libs/jogl/natives/windows-amd64/jogl_mobile.dll.jar"
download="eager"/>
<nativelib
href="libs/jogl/natives/windows-amd64/nativewindow_awt.dll.jar"
download="eager"/>
<nativelib
href="libs/jogl/natives/windows-amd64/nativewindow_win32.dll.jar"
download="eager"/>
<nativelib href="libs/jogl/natives/windows-amd64/newt.dll.jar"
download="eager"/>
<nativelib href="libs/jogl/natives/windows-amd64/oculusvr.dll.jar"
download="eager"/>
<nativelib href="libs/jogl/natives/windows-amd64/soft_oal.dll.jar"
download="eager"/>
</resources>

These DLLs look suspect...do you think they are OK?
Thanks!
  - Doug

On 1/2/18 3:57 AM, gouessej [via jogamp] wrote:

> I had the same stack trace under Windows:
> https://jogamp.org/bugzilla/show_bug.cgi?id=1317#c6
>
> My next comment in the thread above helped me to fix it but it doesn't
> work in Java Webstart.
>
> jawt <https://en.wikipedia.org/wiki/Java_AWT_Native_Interface> is in
> Java itself. If it isn't, it can't work.
> Julien Gouesse | Personal blog <http://gouessej.wordpress.com> | Website
> <http://tuer.sourceforge.net>
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://forum.jogamp.org/Jogl-Jogamp-on-Java-9-tp4038012p4038477.html
> To unsubscribe from Jogl/Jogamp on Java 9, click here
> <
> NAML
> <
http://forum.jogamp.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>