r/java • • 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

47 comments sorted by

View all comments

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.

4

u/eliasv Jul 05 '18

You want Maven support to be built in to the standard libs? That's an awful idea.

Writing code without main iirc was mentioned on the mailing lists, but would be considered largely unrelated and require far greater justification as it's a language level change. This addition didn't touch any specs, its just a JVM feature.

-1

u/pure_x01 Jul 05 '18

Yes that would probably be a good idea. Maven packaging is basically standard. Especially useful for scripts.

1

u/capitol_ Jul 06 '18

Building maven support into the language itself would cement the current structure in place, and make it impossible to evolve the maven environment.

1

u/pure_x01 Jul 06 '18

group:artifact:version could be seen as universal for any package management system.