0

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
Kmara
  • 33
  • 6
  • Have a look at these instructions: https://openjfx.io/openjfx-docs/ – mipa Jan 04 '20 at 08:48
  • Those are the instructions I had originally followed (JavaFX and Eclipse, Non-modular from IDE) but I'm still getting the errors when trying to build the project through Ant. – Kmara Jan 04 '20 at 17:59
  • That's because ant is not supported anymore as far as I know. The error message clearly states that the antlib.xml resource does not exist anymore. Maybe it is time to switch to Maven/Gradle. – mipa Jan 04 '20 at 18:39
  • Odd, I thought Ant was still standard for Eclipse, it came with it and E(fx)clipse uses it. Though it seems to be looking in the wrong place? That antlib.xml path looks like it expects Ant to be part of a JavaFX package? – Kmara Jan 04 '20 at 21:27

1 Answers1

2

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

mipa
  • 10,369
  • 2
  • 16
  • 35