Back to Tools

Java Online Compiler

Run Java 8, 11 and 17 in your browser, no JDK required

Last updated
My tools
No tools yet

Loading...

How to compile and run Java code online

  1. 1

    Paste code or pick an example

    Write Java in the editor, or start from a built-in example such as Hello World, Stream API or lambda expressions.

  2. 2

    Choose a Java version

    Select Java 8, 11 or 17 in the toolbar before running, to check syntax and standard library behaviour on that version.

  3. 3

    Run and read the result

    The first run loads and warms up the Java compiler inside your browser; after that compilation is instant. Program output, compile output and errors each have their own tab.

  4. 4

    Copy the result or share the code

    Copy your code and its output, restore an earlier version from local history, or generate a share link that carries the code.

Features Overview

Java online compiler that compiles and runs Java code directly in your browser, with no JDK to install. Switch between Java 8, 11 and 17 — handy for checking syntax, practising interview questions and teaching demos.

Tool Description

Powerful Java Playground supporting Java 8, 11, and 17 versions. Based on CheerpJ WebAssembly JVM technology, compile and run Java code directly in the browser. Features syntax highlighting, preset examples, history records, and more without installing any software.

Capabilities Checklist

  • Java online compiler: compile and run Java in the browser, with no JDK to install, no environment variables to configure and no IDE to open.
  • Run Java code online across Java 8, 11 and 17, switching versions to compare how the same code behaves.
  • Compile output, program output and errors appear in three separate tabs, so compile-time errors and runtime exceptions never get mixed up.
  • 7 ready-to-run examples built in: Hello World, classes and objects, ArrayList, Stream API, lambda expressions, date and time, and string handling.
  • Java syntax highlighting and line numbers in the editor, one-click copy for both code and output, and a 30-second limit per run.
  • Local history and shareable links: restore code you ran earlier, or generate a URL that carries your code to a classmate or colleague.
  • Built on CheerpJ WebAssembly, so your code compiles and runs inside your own browser — nothing is uploaded, no sign-in and no ads.

Related Tools

Related Guides

Frequently Asked Questions

The way this tool compiles and runs Java in your browser
This tool uses CheerpJ, a WebAssembly-based JVM implementation that allows Java bytecode to run directly in modern browsers without requiring any plugins or installations.
Java versions you can switch between in this tool
Java 8, 11 and 17 are supported. The runtime provides full JDK functionality including the Java compiler.
Third-party JAR support in this tool
Loading third-party external JAR libraries is not supported yet, so code has to stay within the JDK standard library.
Where your code and history are stored
Your code runs entirely in your browser and is not uploaded to any server. History is saved in your browser's local storage, and a link is only generated when you choose to share.
First-run warm-up time and later run speed
The first run loads and warms up the Java compiler in your browser, which usually takes 1-3 minutes depending on your network. The warm-up happens only once; every run after that is instant.
What this tool does not support yet
Standard input, file upload and multi-file projects are not supported, and each run is limited to 30 seconds. It suits verifying the syntax and logic of a single class, not programs that need interactive input or external files.