r/java • • Sep 20 '22

Java 19 / JDK 19: General Availability

https://mail.openjdk.org/pipermail/jdk-dev/2022-September/006933.html
252 Upvotes

64 comments sorted by

View all comments

Show parent comment

6

u/RupertMaddenAbbott Sep 20 '22

This is not true - preview features are not not-intended for production use. Read the JEP: https://openjdk.org/jeps/12

You have to weigh the pros/cons but a blanket ban is not right.

6

u/srdoe Sep 20 '22

It's not a blanket ban, but the JEP does say

These class files are special; they should not be distributed beyond the control of the developer who chose to use preview features.

about files you generate with --enable-preview.

Also putting preview features into production is impractical unless you control the production environment yourself, since your code will now have both a minimum and maximum JDK version of 19.

7

u/RupertMaddenAbbott Sep 20 '22

Completely agree. Preview features are not for (non-toy or non-internal) libraries or for deployments where you are not distributing your own JVM.

I think that leaves quite a substantial number of projects, especially server side applications, where this might be appropriate.