Comment Comment by rotifer FWIW, in an upcoming version of Java you'll likely be able to do this: $ cat Hello.java void main() { System.out.println("Hello, world!"); } $ java --enable-preview --source 21 Hello.java 2>/dev/null Hello, world! $ This is currently a preview feature in Java 21 and 22. parent rotifer 2 years ago