Reputation: 1
I have a JavaFX Application, and I'm using maven to distribute it. Currently, I first create a runtime image of my program with jlink, and then package it with jpackage. However, if I package either a AppImage or a DEB it in a more updated linux distro (e.g. Arch or Debian Unstable/Trixie), and then try to run it in a stable distro (e.g Debian <13), it doesn't run it, because of missing dependencies. Here is a summarized version of my pom.xml, and what I'm currently doing to package my program:
xml
<plugins>
<!-- Plugin to create modularized image -->
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<configuration>
<compress>2</compress>
<noHeaderFiles>false</noHeaderFiles>
<stripDebug>false</stripDebug>
<noManPages>true</noManPages>
<mainClass>com.jurai.Launcher</mainClass>
<launcher>JurAI</launcher>
<jlinkImageName>JurAI</jlinkImageName>
<jlinkZipName>JurAI</jlinkZipName>
</configuration>
</plugin>
<!-- JPackage -->
<plugin>
<groupId>org.panteleyev</groupId>
<artifactId>jpackage-maven-plugin</artifactId>
<version>1.6.5</version>
<configuration>
<name>JurAI</name>
<appVersion>0.0.1</appVersion>
<vendor>com.jurai</vendor>
<destination>target/dist</destination>
<module>jurai/com.jurai.Launcher</module>
<runtimeImage>target/JurAI</runtimeImage>
<icon>${project.basedir}/src/main/resources/img/icon.png</icon>
<javaOptions>
<option>-Dfile.encoding=UTF-8</option>
</javaOptions>
</configuration>
<!-- OS specific configurations -->
<executions>
<execution>
<id>linux_appimage</id>
<configuration>
<type>APP_IMAGE</type>
</configuration>
</execution>
<execution>
<id>linux_deb</id>
<configuration>
<type>DEB</type>
<linuxShortcut>true</linuxShortcut>
<linuxPackageName>jurai</linuxPackageName>
<linuxAppCategory>Utilities</linuxAppCategory>
<linuxMenuGroup>Utilities</linuxMenuGroup>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
To build a .deb package, I run mvn clean compile javafx:jlink jpackage:jpackage@linux_deb, which creates a standard deb packae. To create a .AppImage package, I run mvn clean compile javafx:jlink jpackage:jpackage@linux_appimage. This creates a bare bones binary with libs of my project, which I then have to format into a .AppDir directory, according to the AppDir Appimage specification. Finally, I create the AppImage with AppImageTool.
To build the AppImage, I use a Arch Linux system with OpenJDK 22 installed, and to build the DEB, I use a Debian Trixie (unstable) system with OpenJDK 22 installed. Using stable versions of Debian doesn't work, as they don't have the OpenJDK 22 package. Both files work just fine in updated OS's, but once you try to run them in a older OS, the AppImage just doesn't run at all, and the DEB package reports dependency problems with libglib, libasound and libpng.
From my understanding of Jlink and AppImages, they should include all necessary libs to run the program, but that doesn't seem to be the case here. Is there something I'm missing? Any insight is deeply appreciated.
Upvotes: 0
Views: 152