-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Minor
-
None
-
Affects Version/s: None
-
Environment:
Server running on Oraclelinux8
Docker: FROM openjdk:17-oraclelinux8
Dockerfile: https://github.com/wwlib/docker-minecraft/blob/master/minecraft-server-1.18.1-openjdk17/Dockerfile.openjdk17
README: https://github.com/wwlib/docker-minecraft/blob/master/minecraft-server-1.18.1-openjdk17/README.md
java --version openjdk 17.0.1 2021-10-19 OpenJDK Runtime Environment (build 17.0.1+12-39) OpenJDK 64-Bit Server VM (build 17.0.1+12-39, mixed mode, sharing)
Nashorn 15.3 (JavaScript engine) is loaded as a module via:
java -Xms512M -Xmx1G -cp /minecraft/nashorn --module-path /minecraft/nashorn --add-modules org.openjdk.nashorn -jar spigot-1.18.1.jar
Server running on Oraclelinux8 Docker: FROM openjdk:17-oraclelinux8 Dockerfile: https://github.com/wwlib/docker-minecraft/blob/master/minecraft-server-1.18.1-openjdk17/Dockerfile.openjdk17 README: https://github.com/wwlib/docker-minecraft/blob/master/minecraft-server-1.18.1-openjdk17/README.md java --version openjdk 17.0.1 2021-10-19 OpenJDK Runtime Environment (build 17.0.1+12-39) OpenJDK 64-Bit Server VM (build 17.0.1+12-39, mixed mode, sharing) Nashorn 15.3 (JavaScript engine) is loaded as a module via: java -Xms512M -Xmx1G -cp /minecraft/nashorn --module-path /minecraft/nashorn --add-modules org.openjdk.nashorn -jar spigot-1.18.1.jar
-
CraftBukkit version 3405-Spigot-f4ff00f-d10c35e (MC: 1.18.1) (Implementing API version 1.18.1-R0.1-SNAPSHOT)
-
Yes
Previously in 1.17.1 on openjdk16 & openjdk17 the Nashorn JavaScript engine was found and worked as expected.
Now in 1.18.1 on openjdk17 the Nashorn engine is undefined.
Again, Nashorn 15.3 is NOT included in openjdk17 and is loaded as a module via:
java -Xms512M -Xmx1G -cp /minecraft/nashorn --module-path /minecraft/nashorn --add-modules org.openjdk.nashorn -jar spigot-1.18.1.jar
It seems plugin behavior has changed between 1.17.1 and 1.18.1.
Outside of Spigot, the referenced NashornTest.java CAN access the Nashorn engine and produces this output:
java -cp /minecraft/nashorn -cp . --module-path /minecraft/nashorn --add-modules org.openjdk.nashorn NashornTest VM Details: OpenJDK 64-Bit Server VM 17.0.1+12-39 mixed mode, sharing Nashorn engine found! ECMAScript OpenJDK Nashorn [nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript]
Note: /minecraft/nashorn contains the Nashorn 15.3 jars (https://search.maven.org/artifact/org.openjdk.nashorn/nashorn-core/15.3/jar)
As noted above, previously from within a plugin loaded by 1.17.1 the Nashorn engine CAN be accessed. (java16 and java17)
However, from within a plugin loaded by 1.18.1 the Nashorn engine CANNOT be accessed. (java17)
Example plugin:
Produces the error: "No JavaScript Engine available."
Is this related to:
Update re: Grakkit
Just an FYI unrelated to the original issue (but interesting)
It turns out that Grakkit DOES work in 1.18.1 when using openjdk17 WITHOUT GraalVM: i.e. openjdk:17-oraclelinux8
(https://github.com/wwlib/docker-minecraft/blob/master/minecraft-server-1.18.1-openjdk17/Dockerfile.openjdk17)
It turns out that Grakkit does not use ScriptEngine. It packages and shades the GraalJS library and uses those classes.
What does not work is the combo of GraalVM CE 21.3.0 (ghcr.io/graalvm/graalvm-ce:java17-21.3) + 1.18.1 + Grakkit.