Initializing runtime environment…0%First run compiles Java in-browser; may take 10~30s, please wait
Code
What is Java Online Runner?
This tool is powered by CheerpJ, a Java Virtual Machine compiled to WebAssembly. It compiles and runs Java source code directly in the browser with a full OpenJDK runtime. No JDK installation and no server are required.
Key Features
In-browser compilation: a built-in javac compiler (ECJ) compiles your source inside the browser, consistent with a local environment.
Ready to go: the first load downloads about 20MB of runtime resources which are then cached.
Output capture: System.out and System.err output is shown in real time.
How is this different from the server version?
We also provide a Java Online Compiler with JDK 8 / JDK 21 versions. Use the browser version for lightweight learning and quick testing, and the server version when you need a specific JDK or heavy dependencies.
Usage
Type or paste Java code (a class with a main method).
Click Run to compile and execute.
Compilation errors and output appear in the output panel.