New-learner offer: courses from $12.99 this week. Browse courses
Java 21 (OpenJDK) · free · no sign-up · input supported
Compile and run Java 21 with the OpenJDK, no JDK install needed.
Compile and run Java in your browser with OpenJDK 21. Write a class with a main method, press Run, and see compiler messages and program output side by side.
Modern language features are available, including records, switch expressions, text blocks, var and the Streams API, so you can practise the same Java you will use at work or in your certification exam.
A current long-term-support JDK with records, sealed classes, pattern matching and virtual threads.
javac messages are shown in their own panel with file and line numbers, separate from runtime output.
Feed data to Scanner or BufferedReader through the Input panel to test competitive-programming solutions.
Use public class Main with a public static void main(String[] args) method. The compiler locates the main class automatically, so other names also work.
No. Only the JDK standard library is available in the sandbox.
Each run has a few seconds of CPU time. Waiting for input that was never provided or an infinite loop will hit the limit.
Yes. Records, switch pattern matching, text blocks and var all compile and run.