1
1
---
2
2
category : announcement
3
3
permalink : /news/next-scala-lts.html
4
- title : " Next Scala 3 LTS version"
4
+ title : " Next Scala 3 LTS version will increase minimum required JDK version "
5
5
by : Tomasz Godzik
6
6
---
7
7
8
- ** TLDR; **
8
+ ** TL;DR **
9
9
10
10
An API used in the ` lazy val ` implementation will be removed in a future JDK.
11
11
Its replacement is only available on JDK 9+. Therefore, the Scala 3 Next minors
@@ -14,26 +14,28 @@ in 2025 Q4 and the next LTS will drop JDK 8 support.
14
14
## Intro
15
15
16
16
For the compiler’s second LTS version, the Scala 3 compiler team will be
17
- dropping support for JDK 8 and is considering which later JDK to use.
17
+ dropping support for JDK 8 and is considering which later JDK to require —
18
+ perhaps 11, perhaps 17.
18
19
19
20
## Immediate motivation
20
21
21
22
The recent [ JEP 471] ( https://openjdk.org/jeps/471 ) stated that the memory-access
22
- methods in sun.misc.Unsafe are scheduled for removal in a future release.
23
- Currently, Scala 3 uses sun.misc.Unsafe in its implementation of lazy values.
23
+ methods in ` sun.misc.Unsafe ` are scheduled for removal in a future release.
24
+ Currently, Scala 3 uses ` sun.misc.Unsafe ` in its implementation of lazy values.
24
25
This was needed due to compatibility with JDK 8. In order to support JDK 25+, we
25
- will need to drop usage of Unsafe. We are investigating the required changes
26
- under [ this issue] ( https://github.com/scala/scala3/issues/9013 ) . It also started
27
- to dawn on the compiler team that we might consider stopping to support JDK 8
28
- altogether in a future release of Scala 3.
26
+ will need to drop usage of ` Unsafe ` . We are investigating the required changes
27
+ under [ this issue] ( https://github.com/scala/scala3/issues/9013 ) .
28
+
29
+ It also started to dawn on the compiler team that we might consider dropping
30
+ support for JDK 8 altogether in a future release of Scala 3.
29
31
30
32
## Long term motivation
31
33
32
34
Switching to a newer version of the JDK would allow both the compiler and the
33
35
Scala ecosystem to start using new features and standard library improvements
34
- brought in by JDK 9+. brought in by JDK 9+. This might include a number of JEPs,
35
- which the compiler team will investigate during the coming year. To check the
36
- current status, take a look at the issues marked with the
36
+ brought in by JDK 9+. This might include a number of JEPs (JDK Enhancement
37
+ Proposals), which the compiler team will investigate during the coming year. To
38
+ check the current status, take a look at the issues marked with the
37
39
[ JEP label] ( https://github.com/scala/scala3/issues?q=is%3Aissue+is%3Aopen+label%3Acompat%3Ajava%3Ajep ) .
38
40
39
41
Some of the features that might be interesting to the Scala community are:
@@ -73,13 +75,14 @@ support in favor of JDK 11 or even 17.
73
75
Java examples include:
74
76
75
77
- [ Spring 6] ( https://spring.io/blog/2022/11/16/spring-framework-6-0-goes-ga )
76
- will require JDK 17
78
+ requires JDK 17
77
79
- [ Hibernate] ( https://hibernate.org/orm/releases/6.6/ ) requires JDK 11 and the
78
80
next version will require JDK 17
79
81
- [ Jetty] ( https://jetty.org/docs/jetty/12/index.html ) requires JDK 17
80
82
- [ Logback] ( https://logback.qos.ch/dependencies.html ) requires JDK 11
81
83
- [ JavaFX] ( https://gluonhq.com/products/javafx/ ) requires JDK 21
82
- - [ Vaadin] ( https://github.com/vaadin/platform/releases/tag/24.6.0 ) requires JDK 17
84
+ - [ Vaadin] ( https://github.com/vaadin/platform/releases/tag/24.6.0 ) requires JDK
85
+ 17
83
86
- [ Quarkus] ( https://quarkus.io/blog/quarkus-3-7-released/ ) requires JDK 17
84
87
- [ TensorFlow] ( https://github.com/tensorflow/java ) requires JDK 11
85
88
@@ -98,15 +101,15 @@ Scala examples include:
98
101
the board
99
102
100
103
It is always possible not to update your libraries and compiler version, which
101
- will avoid having to switch to a newer JDK. However, it is highly discouraged,
104
+ will avoid having to switch to a newer JDK. However, that is highly discouraged,
102
105
as it will make you vulnerable to potential security risks.
103
106
104
107
## Plan for making the switch
105
108
106
109
The current plan is to drop support of JDK 8 in one of the future minor releases
107
- of Scala 3 and in the next LTS. The JDK will be either 11 or 17, depending on
108
- the community feedback and our investigations. The current estimate for the next
109
- LTS is Q4 2025.
110
+ of Scala 3 and in the next LTS. The new minimum JDK will be either 11 or 17,
111
+ depending on the community feedback and our investigations. The current estimate
112
+ for the next LTS is Q4 2025.
110
113
111
114
One major challenge will be to preserve backward compatibility. As we change the
112
115
encoding of ` lazy val ` s, we must still be able to use libraries compiled with
@@ -117,14 +120,16 @@ earlier Scala 3 versions.
117
120
The current line of LTS under 3.3.x will be supported for at least another year
118
121
after the release of the next LTS version. That should give you plenty of time
119
122
to migrate. After that, no more security fixes will be available for Scala 3
120
- versions supporting JDK 8. If you are using Scala 3 on JDK 8, do let us know!
123
+ versions supporting JDK 8.
121
124
122
- If it is not possible for you to switch, be sure to send us your feedback so
123
- that we can figure out a way to help you migrate.
125
+ If you are using Scala 3 on JDK 8, do let us know! If it is not possible for you
126
+ to switch, be sure to send us your feedback so that we can figure out a way to
127
+ help you migrate.
124
128
125
129
## Discussions and further reading
126
130
127
131
You can track the current work related to lazy values under
128
- [ this issue] ( https://github.com/scala/scala3/issues/9013 ) . Discussions on the
129
- topic of dropping JDK 8 support will soon be available on the
132
+ [ this issue] ( https://github.com/scala/scala3/issues/9013 ) .
133
+
134
+ Discussions on the topic of dropping JDK 8 support will soon be available on the
130
135
[ Scala contributors forum] ( https://contributors.scala-lang.org/ )
0 commit comments