Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 15, 2025

Overview

This PR implements automatic JRE bundling for cross-platform distribution of the Number Guessing Game, following the approach documented in the libgdx deployment guide. Users can now download and run the game on Windows, macOS, and Linux without needing to install Java separately.

Changes

New Packaging Scripts

Created three new packaging scripts that automatically download Eclipse Adoptium JRE 21 and bundle it with the application:

  • package-jre-windows.sh - Creates NumberGuessingGame-windows.zip (~50MB)
  • package-jre-macos.sh - Creates NumberGuessingGame-macos.zip (~50MB)
  • package-jre-linux.sh - Creates NumberGuessingGame-linux.tar.gz (~50MB)

Each script:

  1. Builds the application JAR
  2. Downloads the platform-specific JRE from Eclipse Adoptium
  3. Bundles the JRE with the game JAR, README, and LICENSE
  4. Creates platform-specific run scripts that use the bundled JRE
  5. Packages everything into a distribution archive

GitHub Actions Integration

Updated .github/workflows/release.yml to automatically build all three platform-specific packages on release creation. The workflow now uploads 6 artifacts to each GitHub Release:

Existing artifacts:

  • app.jar - Standalone JAR (requires Java)
  • archive.zip - Manual installation package (requires Java)
  • numberguessinggame.deb - Debian package (requires Java)

New artifacts:

  • NumberGuessingGame-windows.zip - Windows with bundled JRE ✨
  • NumberGuessingGame-macos.zip - macOS with bundled JRE ✨
  • NumberGuessingGame-linux.tar.gz - Linux with bundled JRE ✨

Documentation Updates

Updated README.md to include:

  • New "Standalone Packages with Bundled JRE (Recommended)" section for end users
  • Clear indication that bundled packages require no Java installation
  • Instructions for developers to build JRE-bundled packages locally
  • Reorganized installation instructions for better clarity

Build Artifact Management

Updated .gitignore to exclude:

  • Temporary JRE download directories (jre-windows/, jre-macos/, jre-linux/)
  • Built package files and extraction directories
  • Ensures repository stays clean during local builds

Benefits

  • No Java Installation Required: Users can download and run immediately
  • Simplified Distribution: One package per platform with everything included
  • Automated Builds: GitHub Actions handles all platform builds automatically
  • Backward Compatible: Existing installation methods (.deb, manual .zip) continue to work
  • Cross-Platform: Works on Windows, macOS, and Linux out of the box

Testing

  • ✅ Successfully built and tested Linux package locally
  • ✅ Verified bundled JRE works correctly (Eclipse Adoptium JRE 21.0.8)
  • ✅ Confirmed game runs without external Java installation
  • ✅ All existing tests pass
  • ✅ GitHub Actions workflow YAML syntax validated

Notes

Linux users have multiple options:

  1. Bundled JRE package - No Java installation needed
  2. Debian package - Uses system Java via apt dependencies
  3. Manual archive - Uses existing Java installation

The bundled JRE packages provide the best out-of-box experience for users who don't have Java installed.

Closes #[issue_number]

Original prompt

This section details on the original issue you should resolve

<issue_title>Bundle jre with app</issue_title>
<issue_description>Use https://libgdx.com/wiki/deployment/bundling-a-jre as a resouce

I want to incorperate this into gh actions so it builds for windows macos and linux on a release - though linux already has the deb package</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #56


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: Project516 <138796702+Project516@users.noreply.github.com>
Copilot AI changed the title [WIP] Bundle JRE with application for cross-platform builds Add JRE bundling for Windows, macOS, and Linux releases Oct 15, 2025
Copilot AI requested a review from Project516 October 15, 2025 13:15
@Project516 Project516 marked this pull request as ready for review October 15, 2025 17:21
@Project516 Project516 merged commit 1a002dc into master Oct 15, 2025
3 checks passed
@Project516 Project516 deleted the copilot/bundle-jre-with-app branch October 15, 2025 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bundle jre with app

2 participants