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

ParameterTypeRequiredDefaultDescription
Java codemultiline
RequiredFull 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 classpathstring
OptionalOptional libraries/JARs to compile and run against (passed via -cp).
Example: C:/apps/lib/*
Supports variables
Program argumentsstring
Optional
Supports variables
java executablestring
OptionaljavaPath to 'java'; defaults to 'java' on PATH.
Supports variables
javac executablestring
OptionaljavacPath to 'javac' (the JDK compiler); defaults to 'javac' on PATH.
Supports variables
Store stdout invariable
Optional
Example: output

More Programs & Processes commands

Ready to automate your busywork?

Start your free 10-day trial today. No credit card, no commitment.