3 ms·
Love it. Don't forget to support shebang. So we can finally use Java as a system scripting language. Maybe something like: #!/usr/bin/env java And maybe
by specialist 4y ago
Love it.
Don't forget to support shebang. So we can finally use Java as a system scripting language.
Maybe something like:
#!/usr/bin/env java
And maybe also allow specifying the runtime version:
#!/usr/bin/env java-12.0.*
- carimura 4y agoLike this? https://dev.java/learn/single-file-program/ https://dev.java/learn/single-file-program/
- specialist 4y agoAha! Exactly like that. Nicely spotted.
- oweiler 4y agoJBang can do this: https://www.jbang.dev https://www.jbang.dev
- specialist 4y agoLooks amazing. Thanks! When I write the Getting Started for my (FOSS) library, I'll definitely make a JBang variant. (Gitpod and SDKMAN also look interesting.) The use of Groovy's @Grab et al is also interesting. I'm eager to see how the dependency, imports, modules, local repo cache story, etc story plays out. Even after all this time, the Java stack still hasn't found its sweet spot. Though I confess I don't know what that'd look like.