I was wondering if it is possible to pass code as an argument to the Java CLI and have it compile and run the code in memory instead of having to write it to a file, compile the file, run the compiled file, then delete everything. If not, is there a way to emulate this behavior in a UNIX environment (Linux/macOS)?
Example:
> java --code 'public class Main { public static void main(String[] args) { System.out.println("Hello, world."); } }'