Deploy JVM games as Linux, Mac, and Windows native bundles

This is a passion project of mine to make it easier to deploy JVM-based games (and JVM apps in general) to desktop. I’m very happy with the result, as IMO, the process is orders of magnitudes simpler than what we had before. Some features include:

  • Native installers for Mac, Windows, and Linux

  • Build native bundles for all platforms from any platform (e.g. You don’t need Mac to make a Mac app. You don’t need Windows to make a Windows app, etc…)

  • Auto updates. Your users automatically get the latest version on each launch

  • Small installer bundle size (3mb compressed)

  • No need to futz with Mac codesigning/notarization

  • Instant download page so your users can download your app as soon as its published.

  • Free, open source

Please take it for a spin, and let me know what you think.

I’ve linked my corresponding Reddit post below as there was quite a bit of discussion there and some of the comments may be interesting to readers here.

3 Likes

Great tool, thank you!

I have a question regarding auto-updating. Does it download all jar files or only the changed jar files?

For example, I am using the jMonkey game engine for my game and it has a bunch of jar files + the jar files from LWJGL,… if I only update my game jar file will the update tool only download that specific jar file or it will download all the jars?

And what about game assets files? (models, textures, sounds,…) I want to publish the assets in the zip file, not in jar file, can auto-update handle those as well?

And again thank you so much for making this great tool :slightly_smiling_face:

Best Regards

Does it download all jar files or only the changed jar files?

It downloads all jar files in your app. It uses npm for versioning and each version is a self-contained package.

For example, I am using the jMonkey game engine for my game and it has a bunch of jar files + the jar files from LWJGL,… if I only update my game jar file will the update tool only download that specific jar file or it will download all the jars?

I hear you there. I have toyed with the idea of adding a runtime dependencies mechanism that would use something like maven to be able to reuse dependencies between versions. Then you could mark certain dependencies to be downloaded directly from Maven central - and thus, reused by all apps that use jDeploy. That isn’t done yet though. I made a special case for JavaFX, where you can just specify whether your app needs JavaFX, and it just use (or download) a JVM that has JavaFX already.

And what about game assets files? (models, textures, sounds,…) I want to publish the assets in the zip file, not in jar file, can auto-update handle those as well?

You can write a “post-package” script to include whatever you want in the app bundle. Essentially, when you hit “publish”, jDeploy creates a directory named “jdeploy-bundle” and it copies everything it needs into it. If you write a “post-package” script, it will be run after the “package” step, but before the “publish” step, so you can copy anything you like in there.

However, I recommend just including these assets in a jar file and adding them to your classpath. I spent a fair bit of time fighting maven in the past trying to do what you’re describing (include some assets outside of the classpath), but have come around to the position that keeping them in a jar, and adding them to the classpath is cleaner and easier in the long run - and more compatible with build tools like Maven.

can auto-update handle those as well?

Yes. Everything in the bundle is updated by the auto-update mechanism.

1 Like

Excellent! I’ll keep an eye out.

Can you make the repository URL configurable? For example to be able to use our own host to download the dependencies.

By the way, is it possible to make a plugin for the Gradle? So that we can directly deploy it via Gradle tasks.

Thanks

Can you make the repository URL configurable? For example to be able to use our own host to download the dependencies.

This could potentially be added. It would help to know the motivation for such moves. E.g. Why not use npm?

By the way, is it possible to make a plugin for the Gradle? So that we can directly deploy it via Gradle tasks.

I will look into this. For now, I’ve focused on being built-tool agnostic for maxium utility. Gradle or Maven integration is trivial as you just need to exec a call to “jdeploy publish” - but I understand that it is easier to have a gradle/maven plugin that wraps this exec call is nicer to use than having to make that call directly in the build script.

1 Like

Sorry if I am being ignorant as I have never used npm but isn’t it for JavaScript/NodeJS apps?

Is there a size limit for the resource files? Also, does it support resume downloads from where it is left? In my game, assets may grow to be larger than 2GB. Is this OK with jDeploy/npm?

isn’t it for JavaScript/NodeJS apps?

npm is a public cloud package deployment system very similar to Maven central. It is is used primarily for NodeJS (npm stands for node package manager), but it can also be used for other things, and, in fact provides many benefits. It is much, much easier to publish to Node than Maven central, which is one the key reasons I chose it as the default cdn for jDeploy. All you need is a free account (which takes a minute to create), and you can publish packages instantly.

Frankly, it is easier to publish to npm than to your own website or to github.

Think of it like a CDN for distributing your app.

If I add support for publishing to your own custom URL, I would just want to know the motivation as that would guide how that feature would need to be implemented.

2 Likes

Now I see why you’re asking these questions. 2GB is massive. I don’t know what the limits are, but you might have to answer some questions if you were pushing 2GB for every couple days for a new version.

The right way to slice that will depend on a few things. When you make a new release, how much is typically unchanged vs changed - and is there a simple rule to define what is unchanged (i.e. not requiring update).

1 Like

Yes, they are game assets like audio, textures, 3d models, animations,… which is common for apps like games.

Most of the things will be unchanged. I will release a new version when I change game scripts or add a new asset (a new character, a new weapon,… into the game) which might be happening every couple of days/weeks. That’s why I would like to be able to download only changed files.

I think a common way is to compare files hash.

Sorry for spamming the thread with my questions :wink:

Is there also an uninstaller created for the app? If so, does it remove both the app and jre or only the app?

Tried to install the Swing Sampler demo on Linux Mint, but I can not lunch it. After lunch it gets closed in a few seconds while printing this in the terminal:

That screenshot makes it look like it is in the process of loading the installer. See the “Checking for Updates… Installing jdeploy-demo-swingset2” progress dialog.

It never gets completed and just gets closed after a few seconds.

Edit:
Is there a log file somewhere?

Is there also an uninstaller created for the app? If so, does it remove both the app and jre or only the app?

I’m working on uninstall support right now. It will be available in an update soon. Currently the app installs inside the $HOME/.jdeploy/packages/your-package-name/version directory. Although, on Windows and Linux there are also some entries added to support appearing in the programs/start menus.

1 Like

This may fall outside the scope of an app update. For things like this, it may be better to have your own internal updates for app resources since only you know the rules. For your usecase, it might make sense to just use a git repository for all of your assets. Use the jgit library to fetch updates either on app load, or when the user initiates it.

1 Like

Yeah, that makes sense. I can use an in-game update for assets and let the jDeploy update the jars and JRE.

Thanks

Is there a log file somewhere?

Yes. Check the ~/.jdeploy/log directory.

Please share the log if it shows anything. I have been testing on Ubunbu mostly. Haven’t tried on Linux Mint, so there might be something that needs adjusting there.

There is not a log directory in my case, only a “packages” directory.

By the way, any plan for adding an installer for Arch64 OSs?