3

I am attempting to create an executable for Linux systems using JPackage. I have successfully created an executable for windows using this command:

jpackage --type msi --name EzQuiz --description "EzQuiz by Benjamin Schreiber" --app-version 1.0 --input D:\dev\IdeaProjects\fblaproj\out\artifacts\fbla_gui_jar --dest D:\Users\Work\Desktop\ --main-jar fbla_gui.jar --win-shortcut

However, when I attempt to make an RPM or DEB or PKG with this same command

jpackage --type rpm --name EzQuiz --description "EzQuiz by Benjamin Schreiber" --app-version 1.0 --input D:\dev\IdeaProjects\fblaproj\out\artifacts\fbla_gui_jar --dest D:\Users\Work\Desktop\ --main-jar fbla_gui.jar --linux-shortcut

I get Error: Invalid or unsupported type: [rpm]

On the JPackage command docs I can clearly see RPM is an accepted value allowed values

How can I create an RPM/PKG/DEB file file with jpackage on windows?

Ben Schreiber
  • 167
  • 1
  • 1
  • 8
  • When I run `jpackage --help` on Windows, I only see `Valid values are: {"app-image", "exe", "msi"}` and as far as I know this is dependent on the platform you're running on. i.e. I don't think it's possible to create an `rpm` on Windows (at least not natively). Though, you might be able to run `jpackage` under WSL to do that, by using a Linux JDK distribution. – Jorn Vernee May 19 '21 at 17:58
  • Yes, that sucks, and Java used to be really multi-platform. One less-than-ideal possibility is to call jpackage once on the desired target OS (Linux in your case), and copy the output files somewhere on the host OS (Windows in your case). You can now call jpackage on the host OS. You can discard all the "runtime/" folder, and copy the content of "app/" folder and replace them inside the target structure. After the merge, you should hopefully get the desired result. – Eric Duminil Mar 14 '22 at 19:24

1 Answers1

2

If this guy's presentation is still up to date, jpackage does not support cross platform compilation or cross platform deployment. Just look at the first slide in https://www.youtube.com/watch?v=ZGW9AalZLN4

The workaround may be to either involve the correct target machine or try yourself following https://www.oracle.com/technical-resources/articles/javase/javatomac3.html

Queeg
  • 7,748
  • 1
  • 16
  • 42