Running Java in Zerethon IDE
How Run compiles your project with javac and starts the entry class, the time limit, input and tests.
Runs in Zerethon IDE · Java 25
Official Java documentation ↗
- Run (Ctrl/⌘+Enter) compiles every
.javafile with javac (Java 25), then runs the entry file's class —Main.java→Main,app/Main.java→app.Main. Make another file the entry with the ▶ button next to it in the explorer. - The entry
Name.javamust declarepublic class Namewithpublic static void main(String[] args). - A compile error stops the run with “Compilation failed · nothing was run” and javac's messages (file and line).
- A run is stopped after 15 seconds (compiling included). Memory is limited, there is no network, and project files are read-only (write to
/tmp). - Run tests (Ctrl/⌘+Shift+Enter) compiles once, then runs the
mainof every class in a file named…Test.java, each in its own JVM. A test passes whenmainfinishes without an exception.
GeometryTest.java
import shapes.Geometry;
public class GeometryTest {
public static void main(String[] args) {
check(Geometry.area(2, 3) == 6, "2 x 3");
System.out.println("geometry ok");
}
static void check(boolean ok, String what) {
if (!ok) throw new AssertionError("failed: " + what);
}
}
shapes/Geometry.java from “Packages and several files”.
Watch out: Java's assert statement is switched off unless the JVM is started with -ea, and tests here run without it — an assert never fails. Throw an exception instead, as check does above.