Run Java
Compile and run Java source code directly. Paste a class with a 'public static void main' method; it is compiled with javac and run with java, and its stdout is captured. (To run a .jar instead, use Run CMD: 'java -jar file.jar'.)
Programs & ProcessesRunJava
What it does
Compile and run Java source code directly. Paste a class with a 'public static void main' method; it is compiled with javac and run with java, and its stdout is captured. (To run a .jar instead, use Run CMD: 'java -jar file.jar'.)
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Java code | multiline | Required | Full Java source with a main() method. Variables are supported: {{{name}}} markers are replaced with their value before compiling. Example: public class Main {
public static void main(String[] args) {
System.out.println("Hello {{{userName}}}");
}
} Supports variables | |
| Extra classpath | string | Optional | Optional libraries/JARs to compile and run against (passed via -cp). Example: C:/apps/lib/* Supports variables | |
| Program arguments | string | Optional | Supports variables | |
| java executable | string | Optional | java | Path to 'java'; defaults to 'java' on PATH. Supports variables |
| javac executable | string | Optional | javac | Path to 'javac' (the JDK compiler); defaults to 'javac' on PATH. Supports variables |
| Store stdout in | variable | Optional | Example: output |
More Programs & Processes commands
Ready to automate your busywork?
Start your free 10-day trial today. No credit card, no commitment.