Remix.run Logo
pron a day ago

Nice, but as of JDK 25 (the preview JEP 445 has become the permanent JEP 512), the canonical Hello World in Java is:

    void main() {
        IO.println("Hello World");
    }
saagarjha 20 hours ago | parent | next [-]

Since it seems like you work on Java, would you mind taking a look at https://bugs.java.com/bugdatabase/view_bug?bug_id=JDK-836673..., where this syntax does not work for shebangs?

prmoustache a day ago | parent | prev | next [-]

Not a java developer but why the void? Shouldn't your main function and program return an integer?

tadfisher a day ago | parent | next [-]

I believe that is a C-ism, where the C runtime calls your main() and exits the process with the return value. The Java equivalent is System.exit(int status).

gavinray a day ago | parent | prev [-]

The return type of a Java main is the JVM platform return type

Sending system signals is external to the JVM platform

troymc a day ago | parent | prev [-]

Thanks, I made a note to update that someday.