Linux builds

Is there a certain type of file that is the industry standard for games on Linux? Like Windows(.exe) and Mac(.app)? And with that, does anyone know how to wrap the jar for linux, similar to what Launch4J does for Windows? Basically I just want an icon on the desktop for Linux, instead of the standard coffee cup.

I hate to say this, because it’s kind of a “well… thanks for nothing!” type of answer but… Linux doesn’t have a unified way of doing this. My experience is limited to Debian based distros and the way they do it is to have a .desktop file somewhere. And that somewhere is also up in the air depending on desktop environment. But here is a link to setting up a desktop file for modern versions of Ubuntu running the Unity environment:

https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles

Hope this helps a little.

I’ve always just distributed a tar.gz and left the buggers to sort it out for themselves. The tar.gz always contains a complete OpenJDK VM, and a file with a .sh extension that’s executable.

Cas :slight_smile:

I wouldn’t bother with reading anything that is Unity specific since Unity is dead! :wink:

You could look at packaging as a .deb file which is really not that difficult - I wrote a blog post on this ages ago.

However, if you want something self-contained, cross-distro and a little friendlier than @princec’s tar.gz then have a look at AppImage. There’s also Snappy and Flatpak, which are likely to be the way of the future, but probably not something to use right now. Yes, it’s Linux, expect at least 3 ways to do anything! ;D However, at least they’re all aiming to work across the board.

Ok thanks guys. I’ll look into these options and see what I think would be the best route to take.

Hi

I created a tool to generate native self-contained application bundles for GNU Linux, OS X and Windows, maybe it can help, it supports several formats under GNU Linux including tar.gz, DEB and RPM:
http://tuer.sourceforge.net/en/documentation/#jndt

To get a launch4j-like exe for linux you can concat your jar with a shell script.
More information here:
https://github.com/maynooth/CS210/wiki/Convert-Java-Executable-to-Linux-Executable.
You can check this app linux version was built this way.

nikolat, your suggestion just allows to write a script to run a JAR, it relies on the JRE installed on the system, it doesn’t help a lot. Moreover, it advises to use Eclipse to create a JAR whereas it’s a lot less flexible and capable than a build tool like Ant.

[quote]nikolat, your suggestion just allows to write a script to run a JAR
[/quote]
Not only to write a script, you will get an executable “”“similar to launch4j”"" executables as FabulousFellini asked above.

[quote]it relies on the JRE installed on the system, it doesn’t help a lot
[/quote]
It is up to you to call any JRE you want (embedded in your package or not).

[quote]Moreover, it advises to use Eclipse to create a JAR
[/quote]
Please check. The build process is not the point. It is about creating a native executable binary. Eclipse is just recommended for the packaging and I agree with you: automating the build process is better.