-4

I have since 3 months problems with my javafx application, the problem is that I can't build my javafx application. When I build this error occurs: Error: Java FX Packager: Can not build artifact - fx: deploy is not available in this JDK

I am using Java SE 14.0.1.

My steps:

  1. create JavaFX
  2. add Java SE 14.0.1 as JDK
  3. add artifact
  4. build

How can I fix the error? I want my javafx application to be runnable on mac, windows and linux.

Is there a way to do this?

mipa
  • 10,369
  • 2
  • 16
  • 35
  • Welcome to stackoverflow. Please provide a [minimal-reproducible-example](https://stackoverflow.com/help/minimal-reproducible-example). – F. Müller Jul 07 '20 at 19:14
  • I've edited the question. –  Jul 07 '20 at 19:51
  • ohhh nooo - not yet another account :((( – kleopatra Jul 07 '20 at 20:23
  • What do you mean? –  Jul 07 '20 at 20:28
  • Could you help me I have the problem since 3 months. –  Jul 07 '20 at 20:36
  • @kleopetra Is this some sort of running gag or? – F. Müller Jul 07 '20 at 20:42
  • 1
    There have been a number of almost-identical questions over the past few days, all posted from accounts created that day. The questions, like this one, are unanswerable as stated (an answer would essentially require an entire tutorial on packaging a JavaFX application). As such the questions attract downvotes and closure, and since this seems to be an attempt to circumvent the rules of the site, the accounts are deleted. Previous examples are https://stackoverflow.com/q/62766354 https://stackoverflow.com/q/62764466 https://stackoverflow.com/q/62761207 https://stackoverflow.com/q/62734364 – James_D Jul 07 '20 at 20:46
  • @James_D Alright. IMO seems to be too easy to open new accounts which is a paradox because you want to keep it user-friendly. On the other hand, you easily get away with stuff like bad quality posts and posts that have obvious duplicates, no formatting at all, poor language, etc. I read comments of users that did not even know how to upvote or accept -they just write it in the comments sometimes.I feel like this could be prevented with a tut for newbies or something. Or is there one? I don't remember - joined like 8 years ago. But good to know - will look for this issue type in the future. – F. Müller Jul 07 '20 at 21:18
  • Could someone define for me the steps I need to take before I execute commands in jpackage? –  Jul 07 '20 at 21:47

1 Answers1

1

This error message is pretty clear, isn't it? The old Java FX Packager does not exist anymore. The new tool to use is "jpackage" which is part of JDK 14. In order to create a platform specific executable image you have to specify --type app-image.

https://docs.oracle.com/en/java/javase/14/docs/specs/man/jpackage.html

And here is even a tutorial project with complete code which I co-authored. Have a look at: https://github.com/dlemmermann/JPackageScriptFX

mipa
  • 10,369
  • 2
  • 16
  • 35
  • I have researched the jpackage application but can't find a command how to export my JavaFX project as an executable file. Could you send me the command? –  Jul 07 '20 at 19:48
  • it would be helpful for me. –  Jul 07 '20 at 20:32