r/java • • Mar 19 '19

Java 12 Released !!!

https://www.oracle.com/technetwork/java/javase/downloads/jdk12-downloads-5295953.html
235 Upvotes

98 comments sorted by

View all comments

78

u/MasterLJ Mar 19 '19

...and here I am still Java 8ing =|

13

u/RotaryJihad Mar 19 '19

You and me both.

15

u/MasterLJ Mar 19 '19

Modules just seem like unnecessary hassle if you already partition your dependencies well, but I'm probably missing some useful use cases. I'm a solo developer, fwiw.

3

u/dpash Mar 19 '19

Modules are particularly useful for libraries. It means they can expose their interfaces and public API and completely hide their implementation and private classes without someone using a non-public API. And now your non-public API has hundreds and thousands of users and it's de facto a public API that you can't change.

Don't think people won't use a non-public API they find in your jar? Look at how many people used sun.misc.Unsafe despite compiler warnings telling them to keep out of anything in the sun package.

1

u/sievebrain Mar 20 '19

Well not really. Users will just put your JAR on the classpath, or use reflection. They aren't going to not use internal APIs just because they're labelled as such and the compiler tries to make life hard.

1

u/dpash Mar 20 '19

Eventually the ability to avoid modules is going away.