Install · Emulators · Devices · Verification · Building · Development · Design

Building

Each game is an independent Ant project that shares the build logic in tools/ant/game-build.xml and the framework in common/src/gamekit. You can build one game or all 100.

Requirements

ToolVersionNotes
JDK17 or newerRuns Ant, the compiler and the test tools.
Python3.8 or newerBootstrap, parallel builds, tests, docs and website generators.
Internet (first run)tools/bootstrap.py downloads the toolchain from Maven Central.

You do not need the Sun/Oracle Wireless Toolkit, ProGuard or a separate preverifier.

Toolchain

python tools/bootstrap.py downloads these into tools/lib/ and checks each file's SHA-256:

How the MIDP build works

ECJ compiles each game with -source 1.3 -target cldc1.1 against the CLDC/MIDP stubs as the boot class path:

The JAR is built with a fixed timestamp so rebuilds are byte-for-byte reproducible, and the JAD's MIDlet-Jar-Size is computed from the finished JAR.

Build commands

Linux / macOS / Git Bash:

python3 tools/bootstrap.py
tools/build-all.sh              # all games, in parallel (tools/build_all.py)
tools/build-all.sh --ant        # all games, sequentially with plain Ant
tools/build-game.sh 042         # one game
tools/build-game.sh 042 test    # one game + reference-runtime smoke test
tools/package.sh                # release/games/*.jar|jad + release/j2me-100-games-v1.0.0.zip

Windows (cmd or PowerShell):

python tools\bootstrap.py
tools\build-all.cmd
tools\build-game.cmd 042
tools\package.cmd

Plain Ant (after bootstrapping) from the repository root:

tools/ant.sh            # = ant dist
tools/ant.sh test       # build + reference-runtime test of every game
tools/ant.sh media      # screenshots and GIFs
tools/ant.sh web        # browser demos (needs a Java 17-21 runtime, see below)
tools/ant.sh package

Output for game NNN-slug is written to games/NNN-slug/dist/<Jar>.jar and <Jar>.jad.

Tests and validation

python tools/run_tests.py --jobs 8     # reference runtime, 5 screen sizes  -> reports/test-report.json
python tools/microemu_check.py         # MicroEmulator 2.0.4 smoke test     -> reports/microemu-report.json
python tools/validate.py               # repository checks                  -> reports/validation-report.md
python tools/gen_docs.py               # regenerate READMEs, docs/download.md, docs/verification.md

See verification.md for what each test does and does not prove.

Browser demos

tools/ant.sh web (or python tools/build_all.py --target web) compiles each game together with the reference runtime to JavaScript using TeaVM. TeaVM 0.10 cannot read JDK 22+ class files, so the TeaVM step runs on a separate Java 17-21 runtime: set TEAVM_JAVA=/path/to/java or unpack a JRE 21 into tools/jre21/. If your default java is already 17-21, nothing needs configuring.

Website

python tools/gen_docs.py
python tools/gen_site.py      # writes website/_site
python -m http.server -d website/_site 8000

Troubleshooting

SymptomFix
The type java.util.ArrayList is not accessible or similarYou used an API that is not in CLDC 1.0 / MIDP 2.0. Use java.util.Vector/Hashtable or plain arrays.
Unsupported class file major version during webTeaVM is running on JDK 22+. Set TEAVM_JAVA to a Java 21 runtime.
Phone says "Invalid JAR" or "JAR size mismatch"Copy the JAR and JAD from the same build; the JAD records the exact JAR size.
python3: not found on WindowsUse python, or the .cmd scripts.

Source: docs/building.md