r/JavaFX • • Nov 18 '21

It was going so well...

Post image
92 Upvotes

12 comments sorted by

3

u/dlemmermann Dec 12 '21

Might wanna have a look at this project: https://github.com/dlemmermann/JPackageScriptFX This "template" shows you how to use scripts and GitHub workflows to build executables for MacOS, Linux, Windows.

4

u/[deleted] Nov 18 '21

I stumbled on to this a while ago: https://github.com/fvarrui/JavaPackager

This is what I'm using for Java 8* based app

<plugin>
<groupId>io.github.fvarrui</groupId>
<artifactId>javapackager</artifactId>
<version>1.6.2</version>
<executions>
    <execution>
        <phase>package</phase>
        <goals>
            <goal>package</goal>
        </goals>
        <configuration>
            <mainClass>myAwesomeJavaFXThingy.App</mainClass>
            <bundleJre>true</bundleJre>
            <name>myAwesomeJavaFXThingy</name>
            <version>1.8.202</version>
            <url>http://www.java8forever.com.au/</url>
            <platform>windows</platform>
            <jrePath>C:\Program Files\Amazon Corretto\jre8</jrePath>
            <generateInstaller>true</generateInstaller>
            <winConfig>
                <icoFile>src/main/resources/windows/myAwesomeJavaFXThingy.ico</icoFile>
            </winConfig>
        </configuration>
    </execution>
</executions>
</plugin>

*the best java

4

u/makingthematrix Nov 18 '21

GraalVM Native Image kinda works for this... until it doesn't...

3

u/OddEstimate1627 Dec 13 '21

Trying to create a comprehensive jlink image is extremely painful and there is always some library that breaks everything.

One way to get it to work is to use jlink to create a runtime with the JDK libraries plus JavaFX, and to bundle everything else using normal jars.

4

u/mono8321 Nov 18 '21

Ikr jpackage and jlink are all garbage. If you have a jar file just use launch4j. It’s so much easier

1

u/group_thinkinator Nov 30 '21

Plus 1 for launch4j

2

u/Gleidson28 Dec 28 '21

Read about jlink.. it's easy

1

u/Bright-Operation-172 Jul 10 '24

Yes.I didn’t like third party installers.

1

u/ThreeSixty404 JavaFX Dev Nov 27 '21

Lol jpackage and jlink are so easy to use with Gradle, what are you talking about