Java compiler

Online Java compiler with a real IDE around it

Write Java, press Run and read the output a moment later. Behind the button is javac on the JDK you choose — from Java 8 to Java 27 — plus completion, quick fixes and a debugger for when a one-liner turns into a project.

  • javac on JDK 8–27
  • Keyboard input
  • Free, nothing to install
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.print("What is your name? ");
        String name = in.nextLine();
        System.out.println("Hello, " + name + "!");
    }
}

Press Shift+F10, type your name into the console and press Enter.

Built on the tools Java and Kotlin developers already trust

Java 8 Java 11 Java 17 Java 21 Java 25 Kotlin 2 Maven Gradle Gradle Kotlin DSL Maven Central JUnit 5 Eclipse JDT google-java-format Step debugger
Java compiler

What you get

Compile and run Java online on JDK 8–27. A free browser IDE with completion, errors as you type, keyboard input, Maven, Gradle and a debugger. No install.

  • javac on real JDKs

    Code is compiled by the javac of an Eclipse Temurin or Azul Zulu JDK, not by a simulator. Every project picks its version, from 8 to 27.

  • Errors before you run

    The Eclipse JDT language server underlines compilation errors as you type. Alt+Enter offers fixes such as a missing import.

  • Keyboard input works

    Programs that read System.in with Scanner or BufferedReader get what you type into the console.

  • Seconds, not minutes

    When the build file has not changed, Run calls javac directly and starts the program without waiting for Maven or Gradle.

  • Grows into a project

    Add packages and classes, split the editor, switch to Maven or Gradle and pull libraries from Maven Central.

  • Saved to your account

    Projects stay in the cloud with Local History for every save and can be downloaded as a .zip archive.

How it works

Under the hood

  1. 01

    How the online compiler runs your code

    When you press Run, the project is compiled with javac from the selected JDK and started with java in an isolated sandbox. Output streams into the Run tool window while the program prints, and the exit code and run time appear when it finishes.

    Compilation errors stop the run and appear twice: underlined in the editor and listed in the Problems tool window with file and line. F2 jumps to the next one.

  2. 02

    More than a single file

    Every program lives in a project, so code is never lost in a pastebin. Create classes with Alt+Insert, find anything with Shift Shift and rename a method across every file with Shift+F6.

    When you need a library, use a Maven or Gradle project, declare the dependency and it is downloaded on the next build together with its sources.

  3. 03

    Limits worth knowing

    Programs run as console applications. They can read input and print output, but they cannot open network ports, show windows or reach the internet, and a run stops after ten minutes.

FAQ

Questions, answered

Is the online Java compiler free?

Yes. Create a free account; there is no trial period and no credit card.

Which Java version compiles my code?

The JDK you pick for the project, from Java 8 to Java 27. Project Structure (Ctrl+Alt+Shift+S) switches the JDK and the language level at any time.

Can I compile several Java files and packages?

Yes. All sources of the project are compiled together, in packages, the same way a desktop IDE does it.

Does Scanner input work?

Yes. Type into the Run console while the program is running and press Enter; the line arrives on System.in.