0

I need deloy application using javafx, but when deloy is by intellij it displays error message:

Java FX Packager: Can't build artifact - fx: deploy is not available in this JDK

I don't know how to deloy application.

Kriss
  • 9
  • 3
  • 1
    Does this answer your question? [Build and deploy javafx application using java11](https://stackoverflow.com/questions/53450011/build-and-deploy-javafx-application-using-java11) – Omar Abdel Bari Apr 01 '21 at 02:09

1 Answers1

1

I stumbled into this issue, too. Here is a link to a youtube that deserves more credit. He has the solution https://www.youtube.com/watch?v=mOv6v_LVCNU So simply put, you need to add a second class that is that main launch for builds.

Start.java

package main;

public class Start {
    public static void main(String[] args){
        Main.main(args);
    }
}

That is what I did first then on your keyboard click

CTRL + ALT + SHIFT + S

Click artifacts, add at the top, Jar, From modules with dependencies. Under the Main class, select the start file provided. And hit ok.

Last, before building, you need to add the bin folder of your JavaFX. Click the plus button under Output Layout; Click File. There get to your JavaFX JDK Directory. Then bin and add all the files in that folder. Hit ok. and ok again.

Build

Go to build in the top menubar. Click build artifacts. A menu will pop up and click build. Boom, you now have a Jar file that can be run with no commands necessary.

Reminder

Do not use JavaFX Application under Artifacts when adding. Make sure it's just a jar. It is no longer supported in the latest version of JavaFX

Jar File Location

Typically under you project file\out\artifacts\ProjectName

Dharman
  • 30,962
  • 25
  • 85
  • 135