Run Java online — Java 8 through 25, real JDK, in a Firecracker microVM.
Java is still the workhorse of enterprise backends, Android, big data (Spark/Kafka), and half of the internet's payment systems. Twenty-eight years old, still shipping a new version every six months.
ls-judge runs Java with the real JDK — no wrappers, no interpreters-pretending-to-be-JVMs. Pick Java 8 for legacy work, Java 11 or 17 for the LTS mainstream, Java 21 for pattern-matching switches and virtual threads, or Java 25 for the very latest.
Both single-file execution (`java` in single-file mode) and traditional multi-file projects work. Class name and file name must match — the entry file is Solution.java with a `public class Solution` containing `main`.
Every submission gets a fresh microVM. That means real classloading, real garbage collector metrics, real timing. Verdicts stream per test case.
Clicking "Run now" opens the playground with this exact code and a matching test case pre-loaded — passes on first Run.
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
System.out.println(n * 2);
}
}
21
42