Java 17 and "Unable to create javax script engine for javascript" #477
-
Hello, we are in the process of upgrading Java from version 11 to version 17 and have a couple of plugins for Services and Publishers. The build failes under Java 17 with the reason https://github.com/Keyfactor/ejbca-ce/blob/main/build.xml#L326 <target name="plugin-bootstrap-build" if="ejbca.plugin.collection">
<!-- Called once immediately before "ejbca.ear" creation if there are any plugins to build -->
<echo message="Plugins found!"/>
<mkdir dir="${ejbca.plugin.gen.path}/lib"/>
<script language="javascript"> <![CDATA[
var path = project.getProperty ("ejbca.plugin.collection");
// Build one plugin at a time
while (path != null) {
var i = path.indexOf (java.io.File.pathSeparatorChar);
var plugin_file = path;
if (i > 0) {
plugin_file = path.substring (0, i);
path = path.substring (i + 1);
} else {
path = null;
}
var antcall = project.createTask ("antcall");
antcall.setTarget ("build-one-plugin");
var prop = antcall.createParam ();
prop.setName ("ejbca.plugin.property.file");
prop.setValue (plugin_file);
antcall.perform ();
}
]]> </script>
</target> It seems that it may be connected with removal of JavaScript engine from JDK 15. Anyone having similar experience or know how to fix this properly? With best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
My Ubuntu says it right out: "Java 15 has removed Nashorn, you must provide an engine for running JavaScript yourself. GraalVM JavaScript currently is the preferred option." Are there any other alternatives to javascript that is built in? Cheers, |
Beta Was this translation helpful? Give feedback.
-
An easy workaround is to build the plugins manually of course and add them. Like for "Using External Plugin" in https://hub.docker.com/r/keyfactor/ejbca-ce. |
Beta Was this translation helpful? Give feedback.
-
One javascript was already replaced in this commit: 82c9cb6 |
Beta Was this translation helpful? Give feedback.
-
I created this internal issue: https://jira.primekey.se/browse/ECA-12150 |
Beta Was this translation helpful? Give feedback.
An easy workaround is to build the plugins manually of course and add them. Like for "Using External Plugin" in https://hub.docker.com/r/keyfactor/ejbca-ce.
But a solution is needed for Java >=17 for sure.