Skip to main content

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

  1. 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

  2. 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

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.