Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Looking for example(java/j2ee web application) how to use java script engine(by name graal.js) with OpenJDK17 or higher #870

Open
muthojukk opened this issue Nov 26, 2024 · 0 comments

Comments

@muthojukk
Copy link

muthojukk commented Nov 26, 2024

Hi everyone,

We have a Confluence app which uses javax.script.* packages provided by Java as part our JavaScript macro. The javax.script.* packages have been removed from Java17. As per the Java docs we need to use GraalVM JDK. Unfortunately, Atlassian does not recommend GraalVM JDK, hence we need to make GraalJS with OpenJDK.

We followed these docs

The above examples work for standalone Java application. Noticed, while executing the maven goals it added module path, upgrade module path and VM options
(-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI --add-exports=java.base/jdk.internal.misc=jdk.graal.compiler --upgrade-module-path=${compiler.dir})

When we use this as part Confluence P2 app we are facing issues. We are able build the app but at run time, we are getting script engine object as null.
ScriptEngine engine = new ScriptEngineManager().getEngineByName("graal.js");

If you guys were able to run the GraalJS code as tomcat web application/Confluence P2 app, please share your insights.

Thanks and regards,
Kiran M

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant