Execute a Java Class with JShell The JShell REPL is useful beyond testing snippets. It is possible to load classes and use them. jshell TestClass.java Then jshell> /list jshell> TestClass.main(null) jshell> /exit References JShell: A Comprehensive Guide to the Java REPL Java Platform, Standard Edition Java Shell User’s Guide