in Education by
I think it goes without saying that I should be able to use Oracle's own JDK with JavaFX (from gluonhq) to build a distributable jar file that users can just USE. After an exhaustive search, much reading (24 hours or more over the last few months)and finally this Google search query: how to make a fat jar -maven -gradle -scala -eclipse -ant -docker -hadoop -netbeans -jerkar -phy -mozni -yogurt -pizza - throwing -python -bacon I'm absolutely at the end of the road. Why on earth is this so much work? How can I build a JavaFX application and give it to people that want to actually use it without knowing anything else except how to use the application itself? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
This has been answered a few times already for Maven and Gradle. Build tools make things way easier than doing it on command line, and not only because of the dependency management. Since you ask specifically about command line, there is already a full set of instructions documented for it here: https://openjfx.io/openjfx-docs/#modular. Non modular App The section Non-Modular from CLI covers JavaFX non-modular projects from command line, and gives you the whole set of instructions to create an old classic fat jar, where all the dependencies, including the JavaFX ones, are bundled all together. There is a note that warns you not to use this procedure: Warning: This is a discouraged tedious error-prone manual process that should be avoided by using the Maven's shade plugin or the Gradle's jar task, in case jlink is not applicable. After you get the fat jar (it can be cross-platform), you can distribute it, and your user will need to have Java installed and run: java -jar myFat.jar Modular App The section Modular from CLI covers JavaFX modular projects from command line, and refers to the use of the jlink command, in terms of distribution, as it creates a custom image that you can send to your users. It is not a fat jar, but it will allow you sending a zip to your user that needs only to be unzipped and run like: hellofx/bin/java -m hellofx/hellofx.HelloFX In this case your user won't even need to have Java installed. And with a little bit of extra work you can also create a batch, so you can run: hellofx However, if you still want to do a fat jar with a modular app, you can still apply the exact same instructions from the non-modular apps. In this case, you will probably have to remove the module-info.java file, as it doesn't really makes sense at this point. Other options You still have a few more options to distribute your application. Custom Java+JavaFX image Another option, covered in the same document, section Custom JDK+JavaFX image, explains how to create your own "JDK" that includes JavaFX. Then you will produce your jar as usual in Java 8 and you will be able to run it with: /path/to/custom/java -jar myFat.jar Note that there are already some JDK distributions that bundle JavaFX, like this one. jpackage jpackage tool is not there yet, but there is an early access: http://jdk.java.net/jpackage/, that is using Java 13-internal. The exiting documentation explains what are the command line options you need to produce a custom image or an installer. Note that you can still use JavaFX 11 or 12 with this. Build tools And finally, you can still decide to use build tools (Maven or Gradle), that will really help you in many ways. See any of the linked questions above.

Related questions

0 votes
    I would like to document in the shaded jar what maven artifacts actually end up in that shaded jar. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 5, 2022 in Education by JackTerrance
0 votes
    v. Which software will you use to make a .jar file? (A) Antivirus (B) MySQL (C) MS Word (D) Net Beans Select the correct answer from above options...
asked Dec 25, 2021 in Education by JackTerrance
0 votes
     “How to lose belly fat” is one of the most common questions out there. And ... you can start using it right away to lose belly fat....
asked Jan 6, 2023 in General by JackTerrance
0 votes
    I'm just on: https://openjfx.io/openjfx-docs/#modular trying to create a jar I can run on other ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I'm developing a Nestjs micro-service and need to run the build in dist folder using below command and ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    I am getting the following error as Java 11 excluded the JavaFX as part of the latest version. Error: ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 3, 2022 in Education by JackTerrance
0 votes
    I have a barChart : that looks like this The bars align to the left of the category, for instance ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    I have a table with on my SQL server with 16 rows, I am trying to print out the BasePT column ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 11, 2022 in Education by JackTerrance
0 votes
    I'm currently working on a project which is a small educational game for children. Right now I am ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 12, 2022 in Education by JackTerrance
0 votes
    I'm currently working on a project which is a small educational game for children. Right now I am ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 10, 2022 in Education by JackTerrance
0 votes
    How do you build a random forest model?...
asked Apr 26, 2021 in Technology by JackTerrance
0 votes
    Can we check the existence of a file without using try statement in Python? Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    How do I check whether a file exists without exceptions?...
asked Jan 9, 2021 in Technology by JackTerrance
0 votes
    import numpy as np from pint import UnitRegistry unit = UnitRegistry() Q_ = unit.Quantity a = 1.0 ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 17, 2022 in Education by JackTerrance
...