简体   繁体   中英

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. I am using the latest Eclipse with the E(fx)clipse plugin. 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.

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.

The errors I'm getting when I use the "Generate and build.xml and run" option are:

[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

The old packager has been removed in Java11. There is now a new packager coming with Java 14. It is already available as an EA release. Have a look here to see how it can be used: https://github.com/dlemmermann/JPackageScriptFX

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM