Javascript for Scripting
Depending on the Java version that you are using and / or whether you are using the Flowable docker images some extra steps might be needed in order to make sure that Javascript works for scripting.
When using Java 8, Java 11, or the Flowable docker images then Javascript for scripting can be used without any modifications.
When using Java 17 then there are 2 possible approached to enable Javascript for scripting:
- When building a custom project the Nashorn Core dependency needs to be added to the project
- When using the out-of-the-box WAR applications the Nashorn Core and its dependencies need to be available on the classpath
How to install Nashorn when using standalone WAR
NOTE: This is only needed if when using Java 17 with the out-of-the-box WAR applications
Download the following JAR files from the listed site references
-
Download the latest Nashorn JAR file from Maven.org. For example the Nashorn version 15.4 jar file (nashorn-core-15.4.jar) can be downloaded here https://search.maven.org/artifact/org.openjdk.nashorn/nashorn-core/15.4/jar
-
Download the following required Nashorn dependencies (as per the Nashorn pom.xml file)
The main org.ow2 main Maven page is here: https://central.sonatype.com/namespace/org.ow2.asm
- asm-7.3.1.jar direct link: org.ow2.asm.asm v7.3.1: https://repo1.maven.org/maven2/org/ow2/asm/asm/7.3.1/asm-7.3.1.jar
- asm-commons-7.3.1.jar direct link: org.ow2.asm.asm-commons v7.3.1: https://repo1.maven.org/maven2/org/ow2/asm/asm-commons/7.3.1/asm-commons-7.3.1.jar
- asm-tree-7.3.1.jar direct link: org.ow2.asm.asm-tree v7.3.1: https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/7.3.1/asm-tree-7.3.1.jar
- asm-util-7.3.1.jar direct link: org.ow2.asm.asm-util v7.3.1: https://repo1.maven.org/maven2/org/ow2/asm/asm-util/7.3.1/asm-util-7.3.1.jar
Deployment of Nashorn into Apache Tomcat
Copy all the JAR files above (five in total) into the Apache Tomcat lib folder. Tomcat will need to restart if it is currently running.