[英]Trouble setting up a JavaFX self-contained build in Eclipse
I am trying to set up a project in Eclipse for a self-contained Java (jdk 13.0.1) and JavaFX (javafx sdk 13.0.1) application.我正在尝试在 Eclipse 中为独立的 Java (jdk 13.0.1) 和 JavaFX (javafx sdk 13.0.1) 应用程序设置一个项目。 I am using the latest Eclipse with the E(fx)clipse plugin.我正在使用带有 E(fx)clipse 插件的最新 Eclipse。 I will eventually add some extra libraries and the the actual code but I'm just working on getting a test build to work and running into some issues.我最终会添加一些额外的库和实际代码,但我只是在努力让测试构建工作并遇到一些问题。 I've tried a lot of the suggestions I've found here but none seem to be working.我已经尝试了很多在这里找到的建议,但似乎都没有奏效。 The current setup shows the jdk in the build path and the user library I created from the javafx jdk jars with no errors or warnings in the project.当前设置显示了构建路径中的 jdk 和我从 javafx jdk jar 创建的用户库,项目中没有错误或警告。
I'm open to suggestions for better ways to accomplish this as well, I'm mostly looking for a way to easily put together an application with a higher version of Java that the user may not have and I will be using JavaFX for the GUI.我也愿意接受更好的方法来实现这一点的建议,我主要是在寻找一种方法来轻松地将应用程序与用户可能没有的更高版本的 Java 组合在一起,我将使用 JavaFX 作为 GUI .
The errors I'm getting when I use the "Generate and build.xml and run" option are:使用“Generate and build.xml and run”选项时遇到的错误是:
[javac] 1 warning
init-fx-tasks:
[taskdef] Could not load definitions from resource com/sun/javafx/tools/ant/antlib.xml. It could not be found.
BUILD FAILED
C:\Users\user\eclipse-workspace\Test\build\build.xml:132: Problem: failed to create task or type javafx:com.sun.javafx.tools.ant:resources
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
No types or tasks have been defined in this namespace yet
See: Ant tasks definitions OpenJDK 11 JavaFX SDK 11 Eclipse 2018-12请参阅: Ant 任务定义 OpenJDK 11 JavaFX SDK 11 Eclipse 2018-12
The old packager has been removed in Java11.旧的打包程序已在 Java11 中删除。 There is now a new packager coming with Java 14. It is already available as an EA release. Java 14 现在有一个新的打包程序。它已经作为 EA 版本提供。 Have a look here to see how it can be used: https://github.com/dlemmermann/JPackageScriptFX看看这里,看看它是如何使用的: https : //github.com/dlemmermann/JPackageScriptFX
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.