Hello,
I'm developing application with Activiti 6 embedded as library, compiled together with my application. I have javascript incorporated in the process as ScriptExecutionListener. Everything works fine under OpenJDK 8.
Now I need to upgrade to Java 11, specifically using the upstream OpenJDK 11. As Nashorn in already removed in Java 11, how could we use javascript in Activiti? I noticed that Nashorn is still included in Oracle JDK 11. But I have to use the upstream OpenJDK 11 due to licensing.
I'm considering to bring Rhino inside my application. Is there any reference to do this?
Thank you.
Solved! Go to Solution.
I have found way to get it works on OpenJDK 11 (and possibly on other JDK).
First, get the rhino-jdk8.zip from https://github.com/zeroboo/java-scripting-rhino-jdk8/releases/tag/v1.0.0 . It contains js.jar and js-engine.jar. Ignore the js.jar as it is readily available in maven central.
Install the js-engine.jar into local maven repository (.m2 folder). Give some sensible name for it, e.g org.mozilla:rhino-js-engine:1.0
Then add the following maven dependencies to our application ;
<!-- this coming from maven central --> <dependency> <groupId>org.mozilla</groupId> <artifactId>rhino</artifactId> <version>1.7.13</version> </dependency> <!-- this coming from local repository --> <dependency> <groupId>org.mozilla</groupId> <artifactId>rhino-js-engine</artifactId> <version>1.0</version> </dependency>
Build and run as usual, now all javascript runs under Rhino.
I have found way to get it works on OpenJDK 11 (and possibly on other JDK).
First, get the rhino-jdk8.zip from https://github.com/zeroboo/java-scripting-rhino-jdk8/releases/tag/v1.0.0 . It contains js.jar and js-engine.jar. Ignore the js.jar as it is readily available in maven central.
Install the js-engine.jar into local maven repository (.m2 folder). Give some sensible name for it, e.g org.mozilla:rhino-js-engine:1.0
Then add the following maven dependencies to our application ;
<!-- this coming from maven central --> <dependency> <groupId>org.mozilla</groupId> <artifactId>rhino</artifactId> <version>1.7.13</version> </dependency> <!-- this coming from local repository --> <dependency> <groupId>org.mozilla</groupId> <artifactId>rhino-js-engine</artifactId> <version>1.0</version> </dependency>
Build and run as usual, now all javascript runs under Rhino.
Hi @jmerari
Great that you found a solution & thanks for updating us on how you did it - really helpful to others.
Cheers,
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.