Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Executable Files Like Launch4j for Other Platforms [closed]

I want to produce executables for other platforms for a Java utility.

I found Launch4J which produces a nice package for Windows, but I'd also like to find something similar that produces the same kind of a thing for Mac users and Linux users.

This isn't for security or code protection but more as a convenience. I really want to accomplish a relatively easy set of tasks:

  1. Find and leverage an existing Java installation.
  2. Apply some default command line parameters
  3. For GUI applications, suppress any console display
  4. Ideally, have the application show up and be recognizable in whatever the equivalent of windows task manager is (i.e. myapp.exe instead of java.exe or javaw.exe)
  5. Apply my own custom icon to the launcher.

Is there a utility that produces cross platform executables or shortcuts? Launch4j runs cross platform but only produces windows executables as far as I can tell.

like image 249
Steve Kallestad Avatar asked Jun 11 '13 13:06

Steve Kallestad


3 Answers

  1. For deploying Java desktop apps., the best option is usually to install the app. using Java Web Start. JWS works on Windows, OS X & *nix.
  2. The best way to deploy a JWS app. or applet is to use the Deployment Toolkit Script. (Addressing your point of 'Find and leverage an existing Java installation'.
like image 109
Andrew Thompson Avatar answered Oct 11 '22 10:10

Andrew Thompson


Here are some possibilities:

  • http://code.google.com/p/appstart/
  • http://commons.apache.org/proper/commons-launcher/
  • http://commons.apache.org/proper/commons-daemon/ (though this seems to be for services)
  • Akuma - http://akuma.kohsuke.org/ (again a service launcher - for POSIX platforms)

The other approach is to use something like Install4j to generate installers for multiple platforms and have that take care of the launcher problem for you.

Finally, the launch4j site says this:

"Running Launch4j on other Java enabled platforms is a matter of getting a binary version of MinGW binutils 2.22 (windres and ld only) for your system or compiling them. If you'll provide these, I'll be able to create a binary package available for download."


Note that a launcher does not have to be a native application (e.g. a "EXE" file) to satisfy most of your requirements.

"I just want my work to be simple to use and look professional."

Hrumph! There are many large companies that ship large (and expensive) Java-based products that don't have a native launcher. My advice: if your customers don't demand it, don't waste your time on it.

like image 30
Stephen C Avatar answered Oct 11 '22 11:10

Stephen C


Have a look at Packr. It can wrap jar into executable for Win, Mac and Unix. Also it packs JRE inside.

like image 39
Metaphore Avatar answered Oct 11 '22 10:10

Metaphore