Java Game Distribution Options
This past week I decided to spend some time looking into options available for distribution of my game now that the time is drawing closer and closer every day.
Since my game is written in Java, technically it is “run on any environment with Java installed”. However, this typically isn’t always the case. Many environments may not have Java installed and expecting the players to install Java separately is generally annoying.
I wanted to make the player experience friendly but still be available on as many systems as possible. This lead me to search out various option and I’ve recently tried out 3 different tools to try and fill this requirement. I’m not going to go into huge details on each tool, but wanted to give my quick thoughts on each.
This is a fantastic option for those only looking to provide binaries for Windows systems. It is very full featured and easy to use. This checks the users system for Java being installed and if not, gives them the opportunity to install using one I suggest. It also has the option to include one with the package to be installed or used directly.
Brought to you by the folks who also created LibGDX, the library I use as the basis for my game. This also produces an environment specific binary but does so for Windows, Linux and Mac. This tool is specifically designed so that you also package a “stripped down” JVM along with the game avoiding the player needing to install one or ensure they have the correct version.
This is a commercial product, but certainly lives up to its own hype. This product allows you to compile a single binary that contains both an environment-specific JVM (their own) the JAR containing your own code/assets. They also provide extensive options for both compiling and distribution (installers etc).
Their price tag is a bit hefty for the average developer, but for larger companies I think they’re pretty reasonable. They do offer lots of options for smaller developer studio’s and even a free version (no Mac support though). They also offer free full licenses to those who release their product as non-commercial which you have to apply for. I applied, but as of this post I haven’t yet to hear back.
I’ve tested their application on both Windows and Linux. Windows was extremely easy to setup and gave me no issues. Their Linux installation was rather convoluted due to it being written still in 32-bit and I was trying to install on a 64-bit Linux environment. I can’t really blame them for this, but do hope they will release a 64-bit version to avoid complex installs. Once installed though, it worked perfectly without any issues.
Launch4J and packr both leave your JAR containing your code external to the binary so it is not hidden from the players. This means you may still want to obfuscate you’re code using a tool like ProGuard to reduce snooping.
ExcelsiorJet’s design combines everything into a single executable thus hiding the JAR file from the player making it extremely difficult to obtain. This does, however, require you to have an environment to build upon for each OS supported because it compiles their custom JVM and native executable for that environment specifically. This is a great advantage for performance, but does add more complexity to the build/distribution cycle for a typical non-commercial Indie developer.
Packr comes with pre-compiled native binaries that allow you to execute the provided JVM and load your JAR file within it. This allows me to avoid having to build the native binary myself.
Including a JVM in all 3 cases does increase the download size of the game, however the ability to have a JVM included with it I believe is the better option to ensure compatibility and ease of use.
What did I decide on?
Since I’m just starting out and my game will be released for free, I’d like to avoid having too much complexity in my release processes.
ExcelsiorJet’s design is complex, but hugely advantageous to those who have the ability to use it to its full extent. Due to the price tag, st this point though I’ve decided to leave it on the side and may revisit later for a larger version of this game or future games. If they should provide me with the free license deal they offer, I will most likely return to this as my final solution.
Launch4J unfortunately only generates Windows binaries which left it out of the race early on. It looks like they’re heading toward providing options for other systems in the future though so I will continue watching for updates.
This leaves me with Packr, which I think overall is my best option going forward as it let’s me have the easiest access to building for all 3 environments without too much effort and I can build all of them from my one machine without the need to setup separate environments.
I still have to work out some details for Mac/iOS releases, but this has been a good step so far.
Thanks for reading!