Back to Tools

Java Online Compiler

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

    Pick a Java version

    Code compiles and runs with Java 8 by default; switch to Java 11 or 17 in the toolbar for newer syntax (var, records, text blocks) — the runtime reloads automatically.

  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: compile and run Java code directly in your browser, with no JDK to install. Switch between Java 8, 11 and 17 — great for quick syntax checks, interview practice, and teaching demos.

Tool Description

Java Online Compiler: Compile and run Java code directly in your browser without installing JDK or IDE. Switch between Java 8, 11 and 17 — modern syntax such as var, records and sealed interfaces compiles and runs per the selected version, with compilation output, execution results, and error messages in three separate tabs. Includes 7 ready-to-run examples and provides local history and code sharing links. This Java Playground runs entirely in your browser locally—code is never uploaded to any server.

Last updated

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: Java 8, 11 and 17 compile and run per the selected version — Java 11 adds var and new String APIs, Java 17 adds records, sealed types, and text blocks. No JDK installation or environment setup needed.
  • 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.

User feedback

Your feedback will be reviewed (and redacted if needed) before it appears publicly. Please do not include emails, passwords, or other personal information.

Your feedback helps us do better ❤️

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 this tool runs
Three versions: Java 8 by default, Java 11 with var and new String APIs, and Java 17 with records, sealed types, text blocks, and switch expressions. Switching versions reloads the runtime automatically; your code and history are kept.
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 wait time and speed of later runs
The first run loads and warms up the Java compiler inside your browser — usually a dozen or so seconds for Java 8. After switching to Java 11 or 17, the first compile also downloads that version's compiler and runtime modules, so it takes longer depending on your network. The warm-up happens only once; later compiles and runs finish in about a second.
What this tool does not support yet
Currently does not support third-party JAR dependencies, code auto-completion, and debugger. Single run time limit is 30 seconds. Standard input, file upload (including ZIP import), and multi-file projects are all directly supported.