Posted by
Predrag Bokšić on
Nov 28, 2017; 8:25pm
URL: https://forum.jogamp.org/How-to-enable-Gluegen-Java3D-on-Java-9-tp4038338.html
I need to enable Java3D libraries for an existing project that functions well on Java 8. However, it fails on Java 9. Ultimately, this needs to run on the latest MacOS computers with the latest JDK9.
As an example of an error, I cite this result. The following command:
System.load("libnativewindow_awt.jnilib");
produces the following error:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x0000000117a0a795, pid=65766, tid=6915
The idea is to compile Gluegen with JDK9 and other system's include files in place (eventually).
Gluegen can be compiled well on JDK8. Given that the environment is set up properly (JAVA_HOME, PATH, CLASSPATH), the build process fails initially. This can be solved by editing the file:
WindowsDynamicLinkerImpl_JNI.c
where these edits need to be made:
#include <stdint.h>
//typedef int intptr_t;
typedef __intptr_t intptr_t;
The compilation functions well then.
Now, the problem remains to compile the project with the JDK9 until the native libraries are built.
With JDK9, the Ant process fails while parsing the XML file. I tweaked the file to accept the Java version 9 (because the versioning principle has changed, and now it's just 9 rather than 1.9). This makes new errors...
ant
Buildfile: E:\idea\gluegen\make\build.xml
jogamp.env.validation:
[echo] ant.version Apache Ant(TM) version 1.10.1 compiled on February 2 2017
[echo] ant.java.version 9
[echo] java.version 9.0.1
[echo] java.home C:\Program Files\Java\jdk
[echo] jvmJava.exe C:\Program Files\Java\jdk/bin/java
[echo] jvmJava7.exe ${jvmJava7.exe}
jogamp.env.init:
[echo] javadoc.xarg1 -Xdoclint:none
[echo] jogamp.jar.codebase
[echo] jogamp.version 2.4.0-rc-20171128
[echo] jogamp.version.int 0914019
[echo] junit.is.disabled ${junit.is.disabled}
[echo] target.user.set ${target.user.set}
[echo] target.sourcelevel 9
[echo] target.targetlevel 9
[echo] target.rt.jar ${target.rt.jar}
BUILD FAILED
E:\idea\gluegen\make\jogamp-env.xml:204: No target.rt.jar specified not found.
So, I am wondering if there is a way to edit the gluegen\make\jogamp-env.xml to include all the jar files at their proper locations and build for JDK9 from there. Should there be any further problems, I would like to post them here.
NOTE that rt.jar has been removed from JDK9 (
https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-A78CC891-701D-4549-AA4E-B8DD90228B4B)
Update.
rt.jar can be included in JAVA_HOME\lib from a previous JDK8 distribution. The Ant process now results in...
generate.java:
[javac] Compiling 6 source files to E:\idea\gluegen\build\classes
[javac] Since fork is false, ignoring memoryMaximumSize setting.
[javac] javac: option --boot-class-path not allowed with target 1.9
BUILD FAILED
E:\idea\gluegen\make\build.xml:945: The following error occurred while executing this line:
E:\idea\gluegen\make\build.xml:723: Compile failed; see the compiler error output for details.