Last active
September 17, 2021 23:43
-
-
Save andirady/be9088908459503f0363eaca4d670f74 to your computer and use it in GitHub Desktop.
Run Java as a script. Requires Java > 9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///usr/bin/env java $0 $@; exit | |
public class hello { | |
public static void main(String[] args) { | |
System.out.println("I'm a script! Or am I? 😉"); | |
} | |
} | |
/* to run it, execute a follows: | |
$ ./hello.java | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated to simpler header. Inspired by jbang.