I made a Java application with Eclipse (exported in *.jar), and I want to export it for Windows (.exe), Linux (.?) and MAC (.?). I don't own any Linux or MAC machine, so I don't know what extension file is required for each one. So I have several questions :
For Windows, I used Launch4j to create my *.exe file, but is there any equivalent for MAC and Linux ?
My application saves options into the Windows registry (I used the "JavaRegisrtyWrapper" library). Is there any "registry" equivalent for MAC and Linux (and how can I read/write informations there) ?
Is it possible to avoid the Windows alert "Unknown publisher" for users when they try to launch the *.exe file after the download ? (And will I have the same problem on MAC and Linux ?). I tried to create my own certificate, and to sign the file with "signtool.exe" but it didn't work.
Thanks !
EDIT : Before converting the *.jar file into any other format, I have to modify my code to get user's OS, and the "documents" folder for each case. I think os.name
can satisfy the first request, but can I use user.home + "Documents"
for Windows, Linux & Mac (if this folder exists...) ?
On Linux and Mac OS you can create a bash script which runs .jar file :
#!/bin/bash
java -jar application.jar
There is no Windows registy equivalent on Linux and Mac Os. You can store your configuration in i.e. text files. Machine specific configs are typically stored in the /etc directory tree.
Here is a similar superuser question: https://superuser.com/questions/295635/linux-equivalent-of-windows-registry
For signing Windows exe files you can try using Microsoft's Sign Tool.
Here is a similar stackoverflow question: Signing a Windows EXE file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With