omni compilerGet the app

Java · Android 7.0+ · free

A Java compiler app for Android

Compile and run Java on your phone without setting up a JDK: write the class, run it with your input, or add test cases and get a verdict for each. omni compiler handles multi-file projects with packages, shows compile errors on the line, and syncs with GitHub or GitLab.

Java on a phone, done properly

  • Several JDK versions

    Choose the Java runtime per run, so records, switch expressions or an older target compile the way your course or contest expects.

  • Scanner and BufferedReader input

    Programs that read System.in take input from the stdin box or from each test case; output is compared with the expected result per test.

  • Compile errors you can tap

    javac's messages are listed with line numbers; tap to jump. A Compile Error verdict never hides the reason.

  • Packages and projects

    Multiple classes in folders, project-wide search, and files opened in place from your file manager or imported from a repository.

Try it with a test case

Paste this into Main.java, add a test case with the input below, and run. Prints 15.

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long sum = 0;
        for (int i = 0; i < n; i++) sum += in.nextLong();
        System.out.println(sum);
    }
}
Test input
3 4 5 6

Questions

Does the main class have to be called Main?

The entry file is the one you mark to run; name the public class to match its file name as Java requires. Main.java with a Main class is the convention most judges use.

Can I build Android apps with it?

No. omni compiler compiles and runs console Java programs and judges them against tests; it is not an Android Studio replacement. For algorithms, assignments and interview practice it is exactly that.

Is the Java compiler free?

Yes. omni compiler is free to download and use, with ads, and you can start as a guest without an account.

Can I run Java offline on my phone?

You can write and edit offline: projects are stored on your phone. Running needs a connection because the code executes in an isolated sandbox on our servers; runs you start offline are queued and sent when you reconnect.

Which Android versions does the Java compiler support?

Android 7.0 and newer, on phones and tablets. Tablets get a split view to edit two files side by side.

Other languages

65 languages in all; see every language page.

Start coding on your phone.

Download omni compiler and run your first program in seconds.