4
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
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
2
u/teapotJava Nov 19 '21
Give Liberica NIK a try https://bell-sw.com/announcements/2021/10/22/the-new-liberica-native-image-kit-21-3-based-on-liberica-17-and-11-is-out/
The icon can be embedded with rcedit https://github.com/oracle/graal/issues/1051#issuecomment-525305868
2
1
1
1
u/ThreeSixty404 JavaFX Dev Nov 27 '21
Lol jpackage and jlink are so easy to use with Gradle, what are you talking about
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.