Java, Maven and Gradle 25 · Compile and run
Open the interactive shell
Try out Java expressions without writing a class. Exit with /exit.
jshell
Official Java, Maven and Gradle 25 documentation
More compile and run commands
- Check the Java version
- Compile a source file
- Run a compiled class
- Run a single source file directly
- Run a jar
- Run with a classpath
All compile and run commands · Java, Maven and Gradle 25 cheatsheet