DEV Community

SnowRSPS
SnowRSPS

Posted on

How we bundled Java 8 into a one-click Windows zip for our game

Disclosure: I'm Snow, and I run SnowRSPS, a free custom 317 game server online since 2012.

Our game client is a Java 8 jar. For years the #1 support question was "it won't open." Players had no Java, the wrong Java, or a 32-bit PC. Here's what we shipped instead.

The layout

SnowRSPS/
  Play SnowRSPS.bat   <- the only thing players click
  SnowRSPS.jar
  java64/             <- Java 8 runtime for 64-bit Windows 7/8/10/11
  java32/             <- Java 8 runtime for old 32-bit Windows
  README-EN.txt
  README-CN.txt
Enter fullscreen mode Exit fullscreen mode

What the launcher does

  1. Picks the right runtime. It checks whether Windows is 64-bit and uses java64, otherwise java32. No system Java needed, no PATH changes.
  2. Survives odd folder names. Many of our players unzip to folders with spaces or Chinese characters, so every path is quoted and the script works from its own directory.
  3. Retries with less memory. If the JVM can't reserve the heap on a weak PC, it relaunches with a smaller -Xmx instead of failing silently.

Why a zip and not an exe

Unsigned .exe downloads get blocked more often by browsers. A zip with a .bat inside goes through more easily. Players still see Windows "protected your PC"; the README says: More info → Run anyway.

Build notes

  • Compile with compliance 1.8 so the bundled runtime can run it.
  • Eclipse → Export → Runnable JAR → "Package required libraries into generated JAR".
  • Ship two READMEs (English + Simplified Chinese). It cut down our support questions a lot.

Takeaways

Bundle the runtime, make the first click obvious, and add a fallback for weak machines.

If you want to see it in action: download the SnowRSPS client.

Top comments (0)