[x3d-public] Fatal X3DJSAIL error using JDK 8u202; JDK12 tests, checked-in X3DJSONLD classes must be 1.8

Brutzman, Donald (Don) (CIV) brutzman at nps.edu
Sun Jun 30 19:53:27 PDT 2019


On 6/29/2019 6:05 PM, Brutzman, Donald (Don) (CIV) wrote:
> 1. I have rebuilt and redeployed X3DJSAIL using JDK 8u212.  No changes in code, all smoke tests pass.  Should be the same as 202 version.  You do not need JDK 8u212 to run the X3DJSAIL .jar since we should remain compatible with any JDK 1.8 version.  Can you please test that the binary .jar works with 202.
> 
> Not yet ready to add OpenJDK or Java 12 testing to the build process.  At some point later this year it will likely happen.

As a preliminary check, I tested X3DJSAIL build.xml target test under (Java JDK 12 / Netbeans 11) and got the following errors related to X3DJSONLD version being too far advanced.  Otherwise everthing worked.  8)

===========================================
Run test 4
jjs examples/Nashorn.js
Warning: toFileStylesheetConversion(X3dToJson.xslt) is overwriting prior file ./examples/Nashorn.json
Script DEF=colorTypeConversionScript contains CDATA source-code text, copied as "#sourceText" using "strings" mode
Script DEF=MaterialModulatorScript contains CDATA source-code text, copied as "#sourceText" using "strings" mode
Exception in thread "main" java.lang.UnsupportedClassVersionError: net/coderextreme/X3DJSONLD has been compiled by a more recent version of the Java Runtime (class file version 56.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at jdk.nashorn.internal.runtime.Context.findClass(Context.java:1051)
	at jdk.nashorn.internal.objects.NativeJava.simpleType(NativeJava.java:498)
	at jdk.nashorn.internal.objects.NativeJava.type(NativeJava.java:322)
	at jdk.nashorn.internal.objects.NativeJava.type(NativeJava.java:314)
	at jdk.nashorn.internal.objects.NativeJava.type(NativeJava.java:310)
	at jdk.nashorn.internal.scripts.Script$Nashorn.:program(examples/Nashorn.js:259)
	at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637)
	at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)
	at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
	at jdk.nashorn.tools.Shell.apply(Shell.java:471)
	at jdk.nashorn.tools.Shell.runScripts(Shell.java:400)
	at jdk.nashorn.tools.Shell.run(Shell.java:179)
	at jdk.nashorn.tools.Shell.main(Shell.java:143)
	at jdk.nashorn.tools.Shell.main(Shell.java:119)
Result: 1
===========================================
Run test 5
HelloWorldProgramOutput.x3d
matches Nashorn.x3d: false
===========================================
===========================================
HelloWorldProgramOutput.x3d
matches Nashorn0.x3d: false
===========================================
Exception in thread "main" java.lang.UnsupportedClassVersionError: net/coderextreme/X3DJSONLD has been compiled by a more recent version of the Java Runtime (class file version 56.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at jdk.nashorn.internal.runtime.Context.findClass(Context.java:1051)
	at jdk.nashorn.internal.objects.NativeJava.simpleType(NativeJava.java:498)
	at jdk.nashorn.internal.objects.NativeJava.type(NativeJava.java:322)
	at jdk.nashorn.internal.objects.NativeJava.type(NativeJava.java:314)
	at jdk.nashorn.internal.objects.NativeJava.type(NativeJava.java:310)
	at jdk.nashorn.internal.scripts.Script$Json.:program(examples/Json.js:8)
	at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637)
	at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)
	at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
	at jdk.nashorn.tools.Shell.apply(Shell.java:471)
	at jdk.nashorn.tools.Shell.runScripts(Shell.java:400)
	at jdk.nashorn.tools.Shell.run(Shell.java:179)
	at jdk.nashorn.tools.Shell.main(Shell.java:143)
	at jdk.nashorn.tools.Shell.main(Shell.java:119)
Result: 1
===========================================

Requests:
a. Can you please stick to java -version 1.8 for all nashorn/json compilation checkins, we are keeping the master at 1.8 until late summer or fall sometime (after X3D-Edit upgrade).  I've been staying clear, if you prefer that I recompile these then please advise.

b. Recommend renaming Nashorn.js in your nashorn/examples into something more descriptive, that name is so generic that it is hard to understand what its goal is.  Similarly for Java.java, Json.json etc.  A README in that directory would help.

all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman


More information about the x3d-public mailing list