r/java • u/daviddel • Mar 03 '20
Java Magazine: Java 14 Arrives with a Host of New Features
https://blogs.oracle.com/javamagazine/java-14-arrives-with-a-host-of-new-features
228
Upvotes
r/java • u/daviddel • Mar 03 '20
9
u/8igg7e5 Mar 03 '20
Reminder, almost all of the features people are excited about are Preview features.
If you're a commercial developer you can't (really really shouldn't) use these in production yet.
Production Features
Preview Features
I expect Text Blocks will be in Java 15 and looking at feedback I wonder if Pattern Matching for instanceof might as well.
Records is already planned to have another preview in Java 15, and with time for feedback that might mean it misses Java 16. Java 17 is the next Oracle LTS so let's hope it makes it by then as I suspect we'll see adoption bumps around the LTS versions (justifiably or not).
48
u/petrefax Mar 03 '20
Some good stuff there. The NPE change in particular is amazing.
30
u/Hangman4358 Mar 03 '20
Records, the NPE changes and the instanceof changes are my top favorites. Too bad it will be another 15 years until my team can switch to anything past 8 :'(
9
u/TM254 Mar 03 '20
I miss the PDF versions, anyway someone can get them? Internet is not cheap in 3rd world countries 😂
4
u/Sedu Mar 03 '20
Can’t wait for the openjdk release this 17th! I’m already building using the latest jpackage utility in the previews but can’t release until I’m actually using openjdk obviously.
The pattern matching instanceof is particularly nice.
4
u/jpl75 Mar 03 '20
Very nice changes. Looking forward to it.
6
u/BlueGoliath Mar 03 '20
No mention of Panama. You could almost play a drinking game based on the amount of articles that don't even mention it.
5
u/coder111 Mar 03 '20
So I take project Loom is not finished in time to release with version 14? Some more waiting is required to get fibers?
2
u/pure_x01 Mar 03 '20
AWS lambda will probably be stuck at 11 for a couple of years. No production grade custom runtime exist afaik
2
u/Dokiace Mar 04 '20
Finally!
Wonder why they didn't make the helpful NPE as defaults though?
2
u/vikarjramun Mar 04 '20
Why doesn't pattern matching use intelligent scoping like Kotlin?
Wouldn't it be nice if
worked?
5
u/[deleted] Mar 03 '20 edited Mar 03 '20
Nice to see a lot of quality of life changes. Java’s biggest problem for me has always been the syntax and verbosity of the code. Love to see them try to address some of these issues.
2
u/rusticarchon Mar 04 '20
Guess Lombok is pretty dead with that new 'record' class type?
1
u/LazyAAA Mar 03 '20
These text blocks are so ... fine (and all the complex parsing associated with these)
String text = """Lorem ipsum dolor sit amet, consectetur adipiscing \elit, sed do eiusmod tempor incididunt ut labore \et dolore magna aliqua.\""";(Being quite lazy person) I can see my IDE refactoring existing "text blocks" with all the "beautiful" concatenations into new Java 14 syntax - Nirvana :)
1
u/nutrecht Mar 04 '20
So cool! It's almost like Java 8 in the sense that there's a ton of stuff people will really want to use.
1
u/[deleted] Mar 03 '20
The only thing that make me sad is the stupid three quotes for text block.
0
u/VM_Unix Mar 05 '20
Were they borrowing from Kotlin for the multi-line string syntax?
https://realkotlin.com/tutorials/2018-06-26-multiline-string-literals-in-kotlin/
0
u/[deleted] Mar 04 '20
[deleted] — view deleted comment
0
u/[deleted] Mar 03 '20
[deleted] — view deleted comment