Javascript in Activiti with OpenJDK 11

cancel
Showing results for 
Search instead for 
Did you mean: 
jmerari
Member II

Javascript in Activiti with OpenJDK 11

Jump to solution

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.

1 Solution

Accepted Solutions
jmerari
Member II

Re: Javascript in Activiti with OpenJDK 11

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

 

View solution in original post

2 Replies
jmerari
Member II

Re: Javascript in Activiti with OpenJDK 11

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

 

View solution in original post

EddieMay
Community Manager
Community Manager

Re: Javascript in Activiti with OpenJDK 11

Jump to solution

Hi @jmerari 

Great that you found a solution & thanks for updating us on how you did it - really helpful to others.

Cheers,

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!