我在尝试使用 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
我在期待什么?
确实不需要发布代码,因为构建项目和运行项目本身都很顺利(没有错误)。尝试使用 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) 问题是当我尝试运行我的主类时,我收到上面的错误。我正在使用 Intellij IDEA
在 pom.xml 中添加了依赖项和插件 Ran mvn clean install,还有 mvn clean javafx:run 但我无法运行我的主类
这是我添加到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)