Table of Contents |
---|
Summary
GraalVM is a full virtual machine in its own right, a component of which is the Graal Script Engine, which can be dropped into existing Java Virtual Machine installations to enable it to be used in place of Nashorn.
Install into JDK -
Status | ||||
---|---|---|---|---|
|
Java 8
Download from Download GraalVM (eg the GraalVM Community 20.1.0 version), the archive that is appropriate for your OS, eg (Java8) graalvm-ce-java8-linux-amd64-20.1.0.tar.gz
Unzip the archive and enter the folder created and copy the following files:
Code Block ./jre/languages/js/graaljs.jar ./jre/languages/js/icu4j.jar ./jre/lib/truffle/truffle-api.jar ./jre/lib/boot/graal-sdk.jar ./jre/lib/boot/graaljs-scriptengine.jar
Paste these files into $JAVA_HOME/jre/lib/ext
$JAVA_HOME/jre/lib/ext should look like the following:
Now once you restart Jira you then be able to use Graal as the scripting language for the script features.
Java 11 / Java 17
Download the Relevant Graalvm files, can be downloaded by using the following:
Code Block wget https://repo1.maven.org/maven2/org/graalvm/sdk/graal-sdk/22.3.0/graal-sdk-22.3.0.jar wget https://repo1.maven.org/maven2/com/ibm/icu/icu4j/71.1/icu4j-71.1.jar wget https://repo1.maven.org/maven2/org/graalvm/js/js/22.3.0/js-22.3.0.jar wget https://repo1.maven.org/maven2/org/graalvm/truffle/truffle-api/22.3.0/truffle-api-22.3.0.jar wget https://repo1.maven.org/maven2/org/graalvm/js/js-scriptengine/22.3.0/js-scriptengine-22.3.0.jar wget https://repo1.maven.org/maven2/org/graalvm/regex/regex/22.3.0/regex-22.3.0.jar
Add module-info.class to icu4j-71.1.jar as this is not included by standard and is required. See the Adding module-info.class within the Jar file heading below for more info.
Place these files into
$JAVA_HOME/jmods
Run the following script to create a new Java Runtime Environment with all of the Java Modules (including the newly added modules):
Code Block jlink --module-path $JAVA_HOME/jmods/ --add-modules ALL-MODULE-PATH --output jre
Update $JAVA_HOME to point to the new JRE folder.
Adding module-info.class within the Jar file
When jar files are made they sometimes do not contain a Module-info.class file which is used to identify that the jar file can be used as a Java module. You are able to create the module-info.class file by using the following commands and this will then mean that the jar file can be used as a module within the Java Runtime Environment.
...
Move module-info.class from out/com.ibm.icu/module-info.class
to the same folder as icu4j-71.1.jar and then run the following to place the created module-info.class file into the jar file.
Code Block |
---|
cd out/com.ibm.icu jar uf ../../icu4j-71.1.jar module-info.class |
...
cd ../.. jar tf icu4j-71.1.jar |
...
rm -rf out |
Create the new runtime folder with graal module support
Run the following script to create a new Java Runtime Environment with all of the Java Modules (including the newly added modules):
Code Block |
---|
jlink --module-path $JAVA_HOME/jmods/ --add-modules ALL-MODULE-PATH --output jre |
Update $JAVA_HOME to point to the new JRE folder.
Install into Jira-install/lib
...