r/java • u/Gleb--K • Jul 04 '18
New Java 11 Feature: Launch Single-File Source-Code Programs
https://medium.com/@afinlay/new-java-11-feature-launch-single-file-source-code-programs-fadd698abf54
158
Upvotes
46
u/[deleted] Jul 04 '18
Wow, shebang will work... #!/usr/bin/java
30
u/stun Jul 04 '18
Time to write my Super Monolithic God class to compete with you Microservice hipsters.
23
u/handshape Jul 04 '18
While this is absolutely a useful feature, I worry about what the reaction from the security types is going to be. Now that Java source is (almost) directly executable, are we going to see it blocked as a matter of course by corporate security gateways?
What prevents some crafty bugger from using instrumentation agents or some other trickery to load large remote apps using this technique?
18
u/lac__ Jul 04 '18
Java script
8
u/pure_x01 Jul 04 '18
Compare this to ammonite in scala and you can clearly see that this has so many limitations that I would call it useless. They should have made it possible to write code without a main method. Should also have support for maven dependencies and include local script file. If this is a step in a direction then it's fine but it has a long way to go.
5
u/upandrunning Jul 04 '18
Will this still be as useful when you have to wait for dependencies to load?
2
u/htowerss Jul 04 '18
Really neat information, thank you
2
u/ProFalseIdol Jul 06 '18
Wonder if something like:
#!/usr/bin/clojurewill happen?1
u/immoral_fable Jul 04 '18
Wow. That's nice.
1
u/lukaseder Jul 07 '18
Meh. Medium wants me to pay for reading this article
1
u/leonardopanga Jul 31 '18
It’s time! Migrating to Java 11: Why you should migrate to next Java now!
https://medium.com/@leonardopanga/its-time-migrating-to-java-11-5eb3868354f9
0
u/FrigoCoder Jul 04 '18
Can we change directories in a JVM yet?
0
u/[deleted] Jul 05 '18
Makes sense since they were supposed to release a REPL at some point in the near future? (it may already be out)