Learn CHEERPJ with Real Code Examples
Updated Nov 25, 2025
Installation Setup
Download or import CheerpJ runtime
Place .jar or .class files in project
Use cheerpjRun() or cheerpjInit() in HTML
Deploy runtime + assets to server
Load application via Java entry point
Environment Setup
Install Java/JDK
Download CheerpJ runtime
Prepare JAR files
Set up index.html loader
Deploy to modern browser environment
Config Files
index.html - launcher
cheerpj.js - main runtime script
cheerpj-*.wasm - wasm modules
app.jar - your Java code
config.json - optional configuration
Cli Commands
java -jar yourapp.jar - test locally
cheerpjify - compile Java to JS/Wasm (AOT)
serve static site - deploy
browser DevTools - runtime debugging
bundle assets - optimize startup
Internationalization
Java’s built-in ResourceBundle supported
UTF-8 fully supported
Locale settings inherited from Java runtime
Dynamic string replacement supported
External i18n libraries compatible
Accessibility
Accessibility depends on Swing implementation
Canvas limits native browser accessibility
Use keyboard events for navigation
Screen-reader support limited
Best for internal enterprise tools
Ui Styling
Swing look and feel preserved
Custom themes rely on Java LAF
Canvas-based rendering only
CSS styling limited (UI not DOM-native)
Custom drawing via Graphics2D
State Management
Java objects stored in CJRE heap
UI state maintained in Swing components
Event dispatch loop inside CJRE
Virtual filesystem for persistence
Optional JS callbacks for state bridging
Data Management
Java I/O APIs backed by browser storage
Use Java JSON libraries normally
Network access via Java HTTP APIs
Local storage mapped to virtual FS
External resources loaded via JS