4 ms·
"Java -- possible, but you'll need a startup script to just call java -jar some-tool.jar; (also not a good fit for short-lived tools, mainly due to startup time
by thangalin 5y ago
"Java -- possible, but you'll need a startup script to just call java -jar some-tool.jar; (also not a good fit for short-lived tools, mainly due to startup times;)"
Technologies to look at:
* Warp Packer -- https://github.com/dgiagio/warp/ https://github.com/dgiagio/warp/
* Liberica Native Image Kit -- https://bell-sw.com/pages/liberica-native-image-kit/ https://bell-sw.com/pages/liberica-native-image-kit/
Warp Packer bundles my JavaFX desktop application, KeenWrite, into single binary executable files:
* https://github.com/DaveJarvis/keenwrite/releases/download/2.5.1/keenwrite.bin https://github.com/DaveJarvis/keenwrite/releases/download/2.... (Linux)
* https://github.com/DaveJarvis/keenwrite/releases/download/2.5.1/keenwrite.exe https://github.com/DaveJarvis/keenwrite/releases/download/2.... (Windows)
* https://github.com/DaveJarvis/keenwrite/releases/download/2.5.1/keenwrite.jar https://github.com/DaveJarvis/keenwrite/releases/download/2.... (JVM)
The start-up time for the first launch of the .bin or .exe is slow because it unpacks to a user directory. Subsequent starts are fast enough, even when running from the command-line as a short-lived task. Here's the script that creates the self-contained executable files:
https://github.com/DaveJarvis/keenwrite/blob/master/installer.sh https://github.com/DaveJarvis/keenwrite/blob/master/installe...
To create a release for all three files, I run a single shell script from a build machine:
https://github.com/DaveJarvis/keenwrite/blob/master/release.sh https://github.com/DaveJarvis/keenwrite/blob/master/release....
I could probably generate a binary for MacOS, but not enough people have asked.