最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Unable to create javax script engine for javascript in Javafx application - Stack Overflow

programmeradmin2浏览0评论

I am using NetBeans 12.0. and windows 10 64 bit.My JDK is 15.0.2 and JavaFx SDK 16. When I try to build my javafx application it shows the following build error:

C:\Users\musta\OneDrive\Documents\NetBeansProjects\JavafxTry\nbproject\jfx-impl.xml:1251: The following error occurred while executing this line: C:\Users\musta\OneDrive\Documents\NetBeansProjects\JavafxTry\nbproject\jfx-impl.xml:1259: Unable to create javax script engine for javascript

BUILD FAILED (total time: 3 seconds)

I am using NetBeans 12.0. and windows 10 64 bit.My JDK is 15.0.2 and JavaFx SDK 16. When I try to build my javafx application it shows the following build error:

C:\Users\musta\OneDrive\Documents\NetBeansProjects\JavafxTry\nbproject\jfx-impl.xml:1251: The following error occurred while executing this line: C:\Users\musta\OneDrive\Documents\NetBeansProjects\JavafxTry\nbproject\jfx-impl.xml:1259: Unable to create javax script engine for javascript

BUILD FAILED (total time: 3 seconds)

Share Improve this question asked Apr 6, 2021 at 6:07 Mustafa IramMustafa Iram 411 gold badge1 silver badge2 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 2

The Nashorn JavaScript Engine has been removed in Java 15: https://openjdk.java/jeps/372

The javascript engine used to be included in the JVM but it has been removed in Java 15.

As an alternative you can use Groovy instead. Groovy looks similar to javascript. Your javascript should be easy to port to Groovy.

When you use the 'groovy-all jar', the script tag looks something like:

<taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpath="path/to/groovy-all-2.4.21.jar" />
<groovy>
    // your Groovy script
</groovy>
发布评论

评论列表(0)

  1. 暂无评论