0

I'm trying to bundle my jar file with a jre into an executable on mac so that users using my application don't need to have java installed on their machine. I'm using IntelliJ's built-in tool that automatically bundles the jar file into a platform specific package but whenever I try to build the artifact I get an error message of

jpackage: No archive found

I was able to create a bundled .exe file with the jar file on windows using launch4j but that tool can't create mac executables (unless I'm mistaken) and it would probably be more convenient to learn how to use the IDE to do it for me.

I can't seem to find out what it is I'm doing wrong, nor can I find anything online about this error message. Any suggestions? (I'm using java 16)

Louis Nguyen
  • 31
  • 1
  • 5
  • I've never tried it on MacOS but you could look at [this Windows one](https://technojeeves.com/index.php/aliasjava1/111-making-native-installable-apps-with-java-9) and ignore the Windows-specific stuff – g00se Jul 20 '21 at 23:18

1 Answers1

1

I was able to fix this problem by deleting and re-doing the configuration for the package artifact build. Everything worked smoothly afterwards

Louis Nguyen
  • 31
  • 1
  • 5
  • 1
    Hey, I just found this inside intellij, but i can't find any other info about it on the internet. Do you know where to look, i'm not very sure of how to use this properly, and i don't know what intellij actually uses to build something like this :( . Do you know where to look? Any websites? I am unable to find anything related to this on google too :( – hidden_machine Aug 18 '21 at 17:38
  • I had the same problem, there's sparsely any information on how this packaging tool works, and even though i got the build process to follow through, it ended up giving me a broken executable. I think the only reliable way to get info on how this thing works is to go through the official documentation on the intellij website – Louis Nguyen Aug 20 '21 at 02:39
  • I went there, i am not able to find it. Closest thing I found on their website(which says nothing about this installer) is this section: https://www.jetbrains.com/help/idea/2021.1/artifacts.html But then again, nothing about `Platform specific package` option in Artifacts settings – hidden_machine Aug 20 '21 at 09:48
  • Actually it uses `jpackage` . You can do exactly(?) what intellij does through `jpackage`. The reason that your installer was probably failing was because the previous version of the app was already installed, and you tried to run the same installer again. To avoid this, all you have to do is change the --app-version every time (a good way is through this batch script: https://stackoverflow.com/a/62819060/16348170 ). But I still don't know how to change this in `intellij` . – hidden_machine Aug 25 '21 at 14:43