Replace CheerpJ with TeaVM for GitHub Pages deployment#67
Merged
Conversation
Co-authored-by: Project516 <138796702+Project516@users.noreply.github.com>
Co-authored-by: Project516 <138796702+Project516@users.noreply.github.com>
Co-authored-by: Project516 <138796702+Project516@users.noreply.github.com>
Co-authored-by: Project516 <138796702+Project516@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add TeaVM for GUI addition to GitHub Pages
Replace CheerpJ with TeaVM for GitHub Pages deployment
Oct 22, 2025
Project516
approved these changes
Oct 27, 2025
Project516
added a commit
that referenced
this pull request
Feb 23, 2026
Replace CheerpJ with TeaVM for GitHub Pages deployment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR replaces CheerpJ with TeaVM for compiling the Number Guessing Game GUI to JavaScript for GitHub Pages deployment. TeaVM provides a more modern, maintainable solution for running Java applications in the browser.
What is TeaVM?
TeaVM is an ahead-of-time compiler for Java bytecode that emits JavaScript. Unlike CheerpJ which emulates a JVM in the browser, TeaVM compiles Java code directly to optimized JavaScript, resulting in better performance and smaller output.
Changes Made
1. New WebGUI Class (
WebGUI.java)Created a browser-native implementation of the game UI using TeaVM's JSO (JavaScript Objects) APIs:
RandomNumber,CheckGuess,GameInfo)2. Build System Updates
io.github.zebalu.teavm-gradle-pluginv1.0.0 tobuild.gradleREADME.mdto reflect Java 11 requirement3. Build Script (
teavm.sh)Replaced
cheerpj.shwith a new script that:WebGUI.javato JavaScript using TeaVM4. GitHub Actions Workflow
Updated
.github/workflows/javadoc.yml:5. Documentation
teavm/README.mdexplaining the TeaVM setupteavm/index.htmlwith responsive CSS.gitignorefor TeaVM build artifactsTechnical Details
Testing
Code Quality
Migration Notes
Breaking Change: The minimum Java version requirement has increased from 8 to 11. This is necessary because:
Users running the JAR file will need Java 11 or higher installed. The standalone packages with bundled JRE are unaffected.
Future Improvements
The TeaVM setup enables potential future enhancements:
Closes #[issue_number]
Original prompt
Fixes #66
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.