Java · version 22

Run Java 22 online

Released March 2024

Non-LTS. Unnamed variables and patterns land stable.

Release

What's in Java 22

  • JEP 456: `_` for unnamed variables and patterns — clean up ignored bindings.
  • JEP 458: launch multi-file source-code programs directly with `java Main.java`.
  • Preview: string templates and stream gatherers.
Starter code

What you get in Java 22

Clicking "Run now" opens the playground with this exact code and a matching test case — passes on first Run.

java
Java 22
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);
  }
}
stdin →21
expected →42
How it runs

How ls-judge runs Java 22

Every submission is compiled and executed inside its own Firecracker microVM — the same isolation primitive AWS Lambda uses. No shared container, no shared kernel with other users' code. The Java 22toolchain shipped with the microVM is the real thing (not a browser-side emulation): syscalls behave the way they do in production, and the compile / runtime behaviour matches what you would see on your own machine with that version installed.

Feed stdin from the Tests panel, watch verdicts stream per test case over a WebSocket. Free to use, no sign-up, works from any browser.

Other Java versions