Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Make a simple JavaFX application into an executable

  1. #1
    Junior Member
    Join Date
    Mar 2023
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Make a simple JavaFX application into an executable

    Hi dear community

    I've made this simple JavaFX application, it only has one class myclass.MyClass, and it has a view.fxml resource.
    I am using IntelliJ on a Mac M1, and it compiles and runs fine.

    The problem is to export it.
    In an ideal world, I would like to have a proper executable (a file you can double-click on) for Mac Apple Silicon, for Mac Intel, for Windows, and for Linux.

    But for now I would be happy just to have a way to distribute it, at least to another Mac. For example an executable jar would work great, then I can ask people to install their own JRE.
    I've been all over the web trying all sorts of things, and I do not know Maven or Gradle so ideally I would rather just simply use cmd line commands.

    The further I've got is following open jfx dot io tutorial (this forum does not let me put the link here sorry), and the last jlink step
    ( jlink --module-path $PATH_TO_FX_MODS:mods --add-modules hellofx --output hellofx )
    got me this folder with a bunch of stuff (including java) which seems to run fine on its own, as long as it's a Mac M1. I cannot see a jar file in there though, and ideally I would want to distribute this on Mac with intel processors.

    Thank you very much in advance
    Simon

  2. #2
    Junior Member
    Join Date
    Mar 2023
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Make a simple JavaFX application into an executable

    Ok just FYI, this was solved by indeed using Maven.

    I followed steps from this https://openjfx.io/openjfx-docs/#install-java
    and the video here https://www.youtube.com/watch?v=EyYb0GmtEX4

    After creating the far jar file, I could bundle it into an application for different OSes.

Similar Threads

  1. javafx collision detection (simple)
    By Mr. Major in forum JavaFX
    Replies: 4
    Last Post: February 2nd, 2018, 07:41 AM
  2. Replies: 0
    Last Post: December 6th, 2017, 05:45 AM
  3. Replies: 6
    Last Post: June 20th, 2014, 07:48 PM
  4. Replies: 1
    Last Post: August 23rd, 2013, 06:33 AM
  5. How to make an executable .jar file?
    By bdennin in forum What's Wrong With My Code?
    Replies: 5
    Last Post: June 11th, 2013, 05:22 PM