Java 17 major language and API improvements
Java LTS Release Adoption
Before we go into details of the enhancements and additions of Java ⑰ lets briefly look at new relic’s yearly State of the Java Ecosystem 2024 report.

Even though Java ⑰ LTS was released in September 2021, in 2023 only ~19% of the projects have been using it. Java ⑧ still had a share of 33%. and Java ⑪ was the dominant release with ~56%.
In 2024 Java ⑰'s share rose to 35% with Java ⑧ still at ~29%. So adoption is still very slow.
Java 17 Language improvements
The following describes selected improvements of the Java language. See the Java 17 release notes. See Java Language Updates for Java SE 17.
With JEP 409 Sealed Classes are now leaving preview state and are finally available for production.
Java 17 is introducing the following language enhancements as developer preview.
JEP 406 is starting with Pattern Matching for switch.
We are not diving into the details of these preview features and defer that until they are moving from preview for general availability.
Sealed Classes
sealed class Shape permits Ellipsis, Rectangle {(1)
}
sealed class Ellipsis extends Shape {(2)
}
final class Circle extends Ellipsis {(3)
}
non-sealed class Rectangle extends Shape {(4)
}
1 | The new keyword permits declares which subclasses are allowed. |
2 | Subclasses may be sealed , |
3 | final or, |
4 | non-sealed |
sealed class Ellipsis extends Shape {(1)
}
final class Circle extends Ellipsis {(2)
}
1 | The permits declaration can be omitted when |
2 | the subclasses are in the same source file. |
package seventeen.lang;(1)
sealed class Shape permits Ellipsis, Rectangle {(2)
}
sealed class Ellipsis extends Shape {(3)
}
1 | Sealed classes and its subclasses must be in the same package (when its in the unnamed module) or in the same module |