Online Java Compiler

Write, compile and run Java code for free, on your computer or phone.

New program

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.

Your programs are saved in this browser. Download a .java file to keep a copy anywhere.

Questions

Is this online Java compiler free?

Yes. It's completely free and needs no sign-up. Your code is compiled and run on Skill Park's secure servers and the output appears below the editor.

Which Java version does it use?

Java 15 (OpenJDK). Lambdas, streams, var, switch expressions and text blocks all work.

How do I give input to Scanner?

Open the Input box below the editor and type your values, separated by spaces or new lines. Each nextInt(), next() or nextLine() call reads from it.

Can I write more than one class?

Yes. Write your other classes in the same file without the word public, and keep main() in public class Main.

Are there limits?

Each run can use a few seconds of time and a limited amount of memory, and programs can't access the internet or files, which is plenty for learning and interview practice.