This is getting a little better nowadays.
> cat Hello.java
void main() {
System.out.println("Hello, World!");
}
> java --enable-preview Hello.java
Hello, World!
Things to notice:
- No compilation step.
- No class declaration.
- Main method is not
public static - No
String[] args.
This still uses preview features though. However, like you demonstrated already, compilation is no longer a required step for simplistic programs like this.