相关疑难解决方法(0)

尝试创建 EXE 文件时出现“无法为 javascript 创建 javax 脚本引擎”错误

我在尝试使用 Netbeans 13 生成 .exe 文件时遇到了这个问题。(打包为 -> exe 安装程序)

完整错误:

C:\Users\*\Documents\NetBeansProjects\*\nbproject\build-native.xml:428: The following error occurred while executing this line:
C:\Users\*\Documents\NetBeansProjects\*\nbproject\build-native.xml:436: Unable to create javax script engine for javascript
BUILD FAILED (total time: 4 seconds)
Run Code Online (Sandbox Code Playgroud)

有谁知道这里似乎有什么问题以及如何解决它?

更新:

操作系统:Windows 10

JavaFX:javafx-sdk-17.0.2

JDK:jdk-17.0.2

我在期待什么?

  • 我期待 .exe 文件

确实不需要发布代码,因为构建项目和运行项目本身都很顺利(没有错误)。尝试使用 Package As -> EXE Installer 生成 .exe 安装程序文件后出现问题(如图所示):所采取的行动

您可以返回查看完整错误,当我打开 build-native.xml 文件时,它会将我指向以下代码行:

  <target name="-jfx-copylibs" depends="init,compile,-pre-pre-jar,-pre-jar,-jfx-copylibs-warning" unless="fallback.no.javascript">
        <jfx-copylibs-js-impl/>
    </target>
    <target name="-jfx-copylibs-warning" if="fallback.no.javascript">
        <echo message="Warning: Dependent Libraries copy (-jfx-copylibs) skipped in fallback build mode due to JDK missing …
Run Code Online (Sandbox Code Playgroud)

java netbeans javafx java-17 netbeans-13

6
推荐指数
1
解决办法
2万
查看次数

错误:缺少 JavaFX 运行时组件,包括 IntelliJ Idea、Maven 和 JDK 19

问题是当我尝试运行我的主类时,我收到上面的错误。我正在使用 Intellij IDEA

在 pom.xml 中添加了依赖项和插件 Ran mvn clean install,还有 mvn clean javafx:ru​​n 但我无法运行我的主类

这是我添加到pom中的内容

<dependency>
  <groupId>org.openjfx</groupId>
  <artifactId>javafx-controls</artifactId>
  <version>19</version>
</dependency>

<dependency>
  <groupId>org.openjfx</groupId>
  <artifactId>javafx-fxml</artifactId>
  <version>19</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
<plugin>
  <groupId>org.openjfx</groupId>
  <artifactId>javafx-maven-plugin</artifactId>
  <version>0.0.8</version>
  <configuration>
    <mainClass>App</mainClass>
  </configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)

javafx intellij-idea maven

4
推荐指数
1
解决办法
2024
查看次数

标签 统计

javafx ×2

intellij-idea ×1

java ×1

java-17 ×1

maven ×1

netbeans ×1

netbeans-13 ×1