java-kata-judge

A local kata judge for Java. Runs JUnit 5 tests from the command line - no Maven, no Gradle, no IDE required.

Shell Script Java Windows Linux macOS CI License: MIT

What is it?

java-kata-judge wraps javac and the JUnit Platform Console Standalone jar into a single command. Point it at a kata directory, and it compiles Solution.java and SolutionTest.java, runs the tests, and shows a clear report.

It tracks completed katas in a .progress file and supports strict mode (--strict) to integrate with CI pipelines. The companion tool java-runner compiles and runs single Java files without any project structure.

bash
$ ./judge.sh katas/01-fizzbuzz

Kata: 01-fizzbuzz
--------------------------------------------------
Compiling...
Compiled successfully
Running tests...

  PASS  returnsFizzForMultipleOfThree()
  PASS  returnsBuzzForMultipleOfFive()
  PASS  returnsFizzBuzzForMultipleOfBoth()
  PASS  returnsNumberAsString()

--------------------------------------------------
All 4 test(s) passed

Progress: 1 / 2 kata(s) completed
--------------------------------------------------
  [DONE]  01-fizzbuzz
  [    ]  02-palindrome

Features

Single command

Compile and run JUnit 5 tests with one command. No project setup.

📊

Progress tracking

A .progress file remembers which katas you have completed.

Strict mode

--strict exits with code 1 on test failure - CI compatible.

🔄

Run all at once

--all runs every kata in the katas/ directory and shows a full summary.

🔨

No build system

Uses the JUnit Platform Console Standalone jar directly. No Maven, no Gradle.

🌐

Cross-platform

Bash script for Linux and macOS. Batch script for Windows. Same behavior everywhere.

Installation

1

Clone the repository

$ git clone https://github.com/llerandi/java-kata-judge.git
$ cd java-kata-judge
$ chmod +x judge.sh
2

Download the JUnit jar

$ mkdir -p lib
$ curl -L -o lib/junit-platform-console-standalone-1.10.2.jar \
    https://repo1.maven.org/maven2/org/junit/platform/\
junit-platform-console-standalone/1.10.2/\
junit-platform-console-standalone-1.10.2.jar
3

Run your first kata

$ ./judge.sh katas/01-fizzbuzz

The jar is listed in .gitignore and is not committed to the repository. Windows users: use judge.bat and download the jar with Invoke-WebRequest or your browser.

Kata structure

Each kata lives in its own directory under katas/. The directory must contain exactly two files:

katas/
└── 01-fizzbuzz/
    ├── Solution.java      # your implementation
    └── SolutionTest.java  # JUnit 5 tests

The naming convention is NN-kata-name where NN is a zero-padded number. Directories are processed in alphabetical order by --all.

Platforms

The judge runs on all major platforms. The behavior and output are identical - only the script differs.

🐧 Linux - judge.sh
macOS - judge.sh
🪟 Windows - judge.bat

The CI pipeline runs on Ubuntu, macOS, and Windows in parallel on every push to main or dev.