Skip to content

Nashorn and Java versions #253

@ahenket

Description

@ahenket

When your jdk is >= 15, you will get an error for Nashorn when you run a build script:

bootstrapFromGithub.build:
Java 15 has removed Nashorn, you must provide an engine for running JavaScript yourself. GraalVM JavaScript currently is the preferred option.

BUILD FAILED
.../Nictiz-testscripts/src/build-multiple.xml:11: The following error occurred while executing this line:
.../Nictiz-testscripts/src/bootstrap-from-github.xml:64: The following error occurred while executing this line:
.../Nictiz-testscripts/lib/Nictiz-tooling-testscripts/generate/2.7.0/ant/build-multiple.xml:11: The following error occurred while executing this line:
.../Nictiz-testscripts/lib/Nictiz-tooling-testscripts/generate/2.7.0/ant/build.xml:85: Unable to create javax script engine for javascript

However ... when you actually have GraalVM, this does not go away:

% java -version
java version "21.0.2" 2024-01-16 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 21.0.2+13.1 (build 21.0.2+13-LTS-jvmci-23.1-b30)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 21.0.2+13.1 (build 21.0.2+13-LTS-jvmci-23.1-b30, mixed mode, sharing)

On macOS for ARM there's version 8, and then version 17 and up. There's no version 9-16 anymore (they were never compiled). On version 1.8 I get:

BUILD FAILED
.../Nictiz-testscripts/src/build-multiple.xml:11: The following error occurred while executing this line:
.../Nictiz-testscripts/src/bootstrap-from-github.xml:64: The following error occurred while executing this line:
.../Nictiz-testscripts/lib/Nictiz-tooling-testscripts/generate/2.7.0/ant/build.xml:123: java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal

The way I currently solved this, is by adding https://repo1.maven.org/maven2/xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar to my ant/lib folder.

It would be ever so nice be able to use idk >= 15 worry free

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions