1
1
---
2
2
category : announcement
3
3
permalink : /news/next-scala-lts.html
4
- title : " Next Scala 3 LTS version will increase minimum required JDK version"
4
+ title : " Next Scala 3 LTS series will increase minimum required JDK version"
5
5
by : Tomasz Godzik
6
6
---
7
7
@@ -10,22 +10,16 @@ by: Tomasz Godzik
10
10
The Scala 3 Next minors in 2025 Q4 and the next LTS will drop JDK 8 support. We
11
11
are seeking feedback on whether the new minimum JDK should be 11 or 17.
12
12
13
- ## Intro
14
-
15
- For the compiler’s second LTS version, the Scala 3 compiler team will be
16
- dropping support for JDK 8 and is considering which later JDK to require —
17
- perhaps 11, perhaps 17.
18
-
19
13
## Immediate motivation
20
14
21
- 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 .
24
- 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 ) .
15
+ The memory-access methods in ` sun.misc.Unsafe ` are scheduled for removal in a
16
+ future JDK, as stated in the recent [ JEP 471 ] ( https://openjdk.org/jeps/471 ) .
17
+ Currently, Scala 3 uses ` sun.misc.Unsafe ` in its implementation of ` lazy val ` .
18
+ In order to support JDK 25+, we will need to drop usage of ` Unsafe ` . We are
19
+ investigating the required changes under
20
+ [ this issue] ( https://github.com/scala/scala3/issues/9013 ) .
27
21
28
- It also started to dawn on the compiler team that we might consider dropping
22
+ It then started to dawn on the compiler team that we might consider dropping
29
23
support for JDK 8 altogether in a future release of Scala 3.
30
24
31
25
## Long term motivation
@@ -40,11 +34,10 @@ check the current status, take a look at the issues marked with the
40
34
Some of the features that might be interesting to the Scala community are:
41
35
42
36
- [ JEP 181] ( https://github.com/scala/scala3/issues/22292 ) will allow classes
43
- that are logically part of the same code entity, but which are compiled to
44
- distinct class files, to access each other's private members. This is
45
- especially useful for nested classes or companions. Currently, the Scala
46
- compiler has to insert public bridge methods to broaden the accessibility of
47
- those members.
37
+ that are logically connected, to access each other's private members. This
38
+ could be useful for representing nested classes and companion objects.
39
+ (Currently, the Scala compiler has to insert public bridge methods to broaden
40
+ the accessibility of those members.)
48
41
- [ JEP 409] ( https://github.com/scala/scala3/issues/22298 ) introduces sealed
49
42
classes. It would allow the compiler to better represent Scala's sealed trait
50
43
hierarchies.
@@ -60,15 +53,16 @@ authors. They currently have to take into account a large number of different
60
53
versions, both for correctness and performance. Thus, the benefits of this
61
54
change will be felt ecosystem-wide.
62
55
63
- JDK 8 was first published on 18th March 2014, over 10 years ago. JDKs have
64
- advanced greatly through that period . In order to stay competitive, using those
65
- advancements is a must. A lot of the existing distributions, such as
66
- [ Oracle's one ] ( https://www.oracle.com/java/technologies/java-se-support-roadmap.html ) ,
56
+ JDK 8 was first published in 2014, over 10 years ago. JDKs have advanced greatly
57
+ since then . In order to stay competitive, using those advancements is a must. A
58
+ lot of the existing distributions, including
59
+ [ Oracle's own ] ( https://www.oracle.com/java/technologies/java-se-support-roadmap.html ) ,
67
60
have already stopped or will soon stop updating JDK 8 with security and other
68
- fixes. Staying on JDK 8 might directly impact issues within your business
69
- applications.
61
+ fixes. It is of course possible not to update your libraries and compiler
62
+ version, to avoid having to switch to a newer JDK. However, that is highly
63
+ discouraged, as it will make you vulnerable to potential security risks.
70
64
71
- Some larger projects within JVM and Scala ecosystems have already dropped JDK 8
65
+ Some larger projects in the Java and Scala ecosystems have already dropped JDK 8
72
66
support in favor of JDK 11 or even 17.
73
67
74
68
Java examples include:
@@ -99,9 +93,7 @@ Scala examples include:
99
93
- [ Li Haoyi's ecosystem] ( https://github.com/com-lihaoyi ) requires JDK 11 across
100
94
the board
101
95
102
- It is always possible not to update your libraries and compiler version, which
103
- will avoid having to switch to a newer JDK. However, that is highly discouraged,
104
- as it will make you vulnerable to potential security risks.
96
+ This shows that the rest of the industry is already moving away from JDK 8.
105
97
106
98
## Plan for making the switch
107
99
0 commit comments