5 Comments

Is this a browser plug-in?

Expand full comment
author

The game? No, it is a desktop application. The era of Java applets is long gone.

Expand full comment

Yeah. I thought so. Sorry for the - my -confusion. I developed in C++ and C# for for Windows many years.

No Java development.

What OS does this target?

I’ve been trying to find a was to target Windows + Mac + Linux.

Expand full comment
author

This is a very simple Java code that doesn't do anything OS-specific, so it should "run everywhere" where Java is supported, i.e. on Windows, Mac, Linux.

In this article, I am only providing the source code, no binaries. The intended audience are Java developers, who presumably already have some Java development environment installed, so they would just download the source code and run it.

If instead I just tried to give someone (not a developer) the binaries of the game to play it, there are basically two options.

1) If the person already has Java runtime installed on their computer, then all I need to do is compile the game to a "*.jar" archive, in this case about 90 KB large, and send them the file, which will start upon doubleclick. The file would be exactly the same for every OS.

2) If the person has nothing installed, so I need to provide everything, there is a tool called "jlink", which creates a folder with over hundred files, together about 90 MB large, containing a Java runtime and the game. I would probably send it as a "*.zip" file. They would extract it on their computer and click a "*.bat" file on Windows, or a shell script on Mac or Linux (both options would be provided).

The second option is better because it assumes nothing. The disadvantage is that if you install dozen small games like this, you get dozen copies of the same Java runtime. However, these days 90 MB is not a big deal.

I do not have much experience with jlink, so I am not giving advice on how to use it, but I have succeeded at home to create the 90 MB installation, and then copied it to my kids laptop (which didn't have any previous version of Java), and it worked.

So if you want to make a desktop application for Windows + Mac + Linux, and you do not mind the extra 90 MB, then Java is an option.

Expand full comment

Thanks for the information.

Expand full comment