malaporte / nashorn-commonjs-modules

CommonJS modules support for Nashorn
MIT License
108 stars 31 forks source link

Compilation/Use Failing #33

Closed sjerman closed 6 years ago

sjerman commented 6 years ago

Hi,

I'm having trouble using the library ... I was getting NPEs when using it, so checked out and triedto build the source locally, using this environment:

Java version: 1.8.0_25, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac"

As far as I can tell, standard Mac with standard Oracle J8 JDK...

Anyway, I get the following error running Maven:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.239 s
[INFO] Finished at: 2018-01-27T09:26:23-07:00
[INFO] Final Memory: 20M/325M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project nashorn-commonjs-modules: Compilation failure: Compilation failure:
[ERROR] /Users/sjerman/Git/nashorn-commonjs-modules/src/test/java/com/coveo/nashorn_modules/ModuleTest.java:[420,34] cannot find symbol
[ERROR] symbol:   method identical(jdk.nashorn.api.scripting.ScriptObjectMirror,jdk.nashorn.api.scripting.ScriptObjectMirror)
[ERROR] location: class jdk.nashorn.api.scripting.ScriptObjectMirror
[ERROR] /Users/sjerman/Git/nashorn-commonjs-modules/src/test/java/com/coveo/nashorn_modules/ModuleTest.java:[428,34] cannot find symbol
[ERROR] symbol:   method identical(jdk.nashorn.api.scripting.ScriptObjectMirror,jdk.nashorn.api.scripting.ScriptObjectMirror)
[ERROR] location: class jdk.nashorn.api.scripting.ScriptObjectMirror
[ERROR] /Users/sjerman/Git/nashorn-commonjs-modules/src/test/java/com/coveo/nashorn_modules/ModuleTest.java:[437,34] cannot find symbol
[ERROR] symbol:   method identical(jdk.nashorn.api.scripting.ScriptObjectMirror,jdk.nashorn.api.scripting.ScriptObjectMirror)
[ERROR] location: class jdk.nashorn.api.scripting.ScriptObjectMirror
[ERROR] -> [Help 1]
[ERROR]

I loaded in Eclipse and get same compile errors, looking at ScriptObjectMirror object in Eclipse browser it doesn't have identical method.

I'm not sure what the issue is but starting to wonder if the Nashorn API has changed... which is weird.

Any suggestions?

arisone commented 6 years ago

Hi @sjerman of course Nashorn API is changed since Java 1.8.0.25, it was new-born. For example in J8u40 was a big milestone for Nashorn. I suggest you to update your jdk (last version for J8 should be 161). Hope this help Aris

malaporte commented 6 years ago

Yup, I'd recommend upgrading to a newer JDK, as there are definitively issues when running with an "early" version of Nashorn.

sjerman commented 6 years ago

Ah... stupid me. I forgot Apple removed inbuilt Java JDK support ... and thought that since it kept on updating the JRE used for applets that I was up to date... even in the face of the version reported.

Thanks for the pointer.