Skip to content

Commit 1055449

Browse files
committed
Drop support for Java 8, make Java 11 the minimum
- Remove javaToolchainVersion := "8" from all sbt projects - Remove minimized8 test project and tests/minimized/.j8 directory - Switch javac options from "-source/-target 1.8 -bootclasspath rt.jar" to "--release 11" in JavaToolchainPlugin - Drop Java 8 specific code from JavaVersion (isJava8, JAVA8_VERSION, 1.8 parsing) and PackageTable (indexBootstrapClasspath); default Java version is now 11 - Remove Java 8 special cases from GradleJavaCompiler (jre/lib copy) and ScipBuildTool (M1 amd64 hack and javac module options conditional) - Remove Java8Only test tag and the playframework/checkerframework Java 8 tests; bump JVMSupport minimum to 11; allJava is now [11,17,21] - Bump CI matrices and release workflows from Java 8 to Java 11 - Drop Java 8 from docker-setup.sh pre-install list - Bump example pom.xml and Maven plugin template to Java 11 - Update docs to reflect Java 11 as the minimum supported version
1 parent 4486a05 commit 1055449

22 files changed

Lines changed: 40 additions & 246 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
# NOTE(olafurpg) Windows is not enabled because it times out due to reasons I don't understand.
1515
# os: [windows-latest, ubuntu-latest]
1616
os: [ubuntu-latest]
17-
java: [8, 11, 17, 21]
17+
java: [11, 17, 21]
1818
steps:
1919
- uses: actions/checkout@v4
2020

@@ -140,7 +140,7 @@ jobs:
140140
strategy:
141141
fail-fast: false
142142
matrix:
143-
java: [8, 11, 17, 21]
143+
java: [11, 17, 21]
144144
steps:
145145
- uses: actions/checkout@v4
146146

.github/workflows/release-cli.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/setup-java@v4
1818
with:
1919
distribution: 'temurin'
20-
java-version: 8
20+
java-version: 11
2121

2222
- uses: coursier/setup-action@v3
2323
with:

.github/workflows/release-docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/setup-java@v3
1515
with:
1616
distribution: 'temurin'
17-
java-version: 8
17+
java-version: 11
1818
cache: 'sbt'
1919
- uses: sbt/setup-sbt@v1
2020
- uses: docker/setup-buildx-action@v1

.github/workflows/release-maven.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/setup-java@v3
1515
with:
1616
distribution: 'temurin'
17-
java-version: 8
17+
java-version: 11
1818
cache: 'sbt'
1919
- uses: sbt/setup-sbt@v1
2020
- name: Publish ${{ github.ref }}

bin/docker-setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ rm gradle.zip
1515
mv /opt/gradle/*/* /opt/gradle
1616

1717
# pre-install JDK for all major versions
18-
for JVM_VERSION in 21 17 11 8
18+
for JVM_VERSION in 21 17 11
1919
do
2020
coursier java --jvm $JVM_VERSION --jvm-index https://github.com/coursier/jvm-index/blob/master/index.json -- -version
2121
done

build.sbt

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ lazy val agent = project
8888
.settings(
8989
fatjarPackageSettings,
9090
javaOnlySettings,
91-
javaToolchainVersion := "8",
9291
moduleName := "semanticdb-agent",
9392
libraryDependencies ++=
9493
List(
@@ -110,8 +109,7 @@ lazy val gradlePlugin = project
110109
scalaVersion := V.scala213,
111110
buildInfoPackage := "com.sourcegraph.scip_java",
112111
publish / skip := true,
113-
javaToolchainVersion := "8",
114-
scalacOptions ++= Seq("-target:8", "-release", "8"),
112+
scalacOptions ++= Seq("-target:11", "-release", "11"),
115113
libraryDependencies ++=
116114
List(
117115
"dev.gradleplugins" % "gradle-api" % V.gradle % Provided,
@@ -150,7 +148,6 @@ lazy val javacPlugin = project
150148
fatjarPackageSettings,
151149
javaOnlySettings,
152150
moduleName := "semanticdb-javac",
153-
javaToolchainVersion := "8",
154151
javacOptions += "-g",
155152
(assembly / assemblyShadeRules) :=
156153
Seq(
@@ -186,7 +183,6 @@ lazy val scipProto = project
186183
.in(file("scip-java-proto"))
187184
.settings(
188185
moduleName := "scip-java-proto",
189-
javaToolchainVersion := "8",
190186
javaOnlySettings,
191187
libraryDependencies +=
192188
"com.google.protobuf" % "protobuf-java-util" % V.protobuf,
@@ -200,7 +196,6 @@ lazy val scip = project
200196
.settings(
201197
publishMavenStyle := true,
202198
moduleName := "scip-semanticdb",
203-
javaToolchainVersion := "8",
204199
javaOnlySettings,
205200
(Compile / PB.targets) :=
206201
Seq(PB.gens.java(V.protobuf) -> (Compile / sourceManaged).value),
@@ -212,7 +207,6 @@ lazy val mavenPlugin = project
212207
.in(file("maven-plugin"))
213208
.settings(
214209
moduleName := "maven-plugin",
215-
javaToolchainVersion := "8",
216210
javaOnlySettings,
217211
libraryDependencies ++=
218212
Seq(
@@ -388,12 +382,6 @@ lazy val minimized = project
388382
.dependsOn(agent, javacPlugin)
389383
.disablePlugins(JavaFormatterPlugin)
390384

391-
lazy val minimized8 = project
392-
.in(file("tests/minimized/.j8"))
393-
.settings(minimizedSettings, javaToolchainVersion := "8", javaOnlySettings)
394-
.dependsOn(agent, javacPlugin)
395-
.disablePlugins(JavaFormatterPlugin)
396-
397385
def javacModuleOptions = List(
398386
"-J--add-exports",
399387
"-Jjdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",

docs/contributing.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,4 @@ write tests because:
9595
[snapshot testing](https://jestjs.io/docs/en/snapshot-testing), which is a
9696
testing technique that's heavily used in this codebase.
9797
- Multiline literal strings in Scala make it easy to write unit tests for source
98-
code (which is always multiline). Modern versions of Java support multiline
99-
string literals, but they're not supported in Java 8, which is supported by
100-
scip-java.
98+
code (which is always multiline).

docs/getting-started.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ finished indexing the project.
3535

3636
> The `sourcegraph/scip-java` Docker image is made available for convenience at
3737
> the cost of performance. The `sourcegraph/scip-java` image is a big download
38-
> because it includes pre-installed versions of Java 8, Java 11, and Java 17.
38+
> because it includes pre-installed versions of Java 11, Java 17, and Java 21.
3939
> The `sourcegraph/scip-java` image has slow performance because it needs to
4040
> download all external dependencies of your codebase on every invocation.
4141
>
@@ -46,9 +46,6 @@ Java 17 is the default Java version in the `sourcegraph/scip-java` Docker image.
4646
Use the following commands to use a different JVM version:
4747

4848
```sh
49-
# Java 8
50-
docker run -v $(pwd):/sources --env JVM_VERSION=8 sourcegraph/scip-java:latest scip-java index
51-
5249
# Java 11
5350
docker run -v $(pwd):/sources --env JVM_VERSION=11 sourcegraph/scip-java:latest scip-java index
5451

@@ -227,9 +224,10 @@ of Java versions.
227224
| Java version | Support | Tracking issue |
228225
| ------------ | ---------------------------- | -------------- |
229226
| Java 7 || |
230-
| Java 8 | | |
227+
| Java 8 | | |
231228
| Java 11 || |
232229
| Java 17 | ✅, requires `--add-exports` | |
230+
| Java 21 | ✅, requires `--add-exports` | |
233231

234232
For Java 17 and newer versions, the following JVM options are required:
235233

docs/manual-configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ targetroot directory.
135135

136136
```
137137
❯ find $TARGETROOT -type f
138-
build/semanticdb-targetroot/META-INF/semanticdb/j8/src/test/java/example/ExampleTest.java.semanticdb
139-
build/semanticdb-targetroot/META-INF/semanticdb/j8/src/main/java/example/Example.java.semanticdb
138+
build/semanticdb-targetroot/META-INF/semanticdb/j11/src/test/java/example/ExampleTest.java.semanticdb
139+
build/semanticdb-targetroot/META-INF/semanticdb/j11/src/main/java/example/Example.java.semanticdb
140140
...
141141
```
142142

examples/maven-example/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
<properties>
1616
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17-
<maven.compiler.source>1.8</maven.compiler.source>
18-
<maven.compiler.target>1.8</maven.compiler.target>
17+
<maven.compiler.source>11</maven.compiler.source>
18+
<maven.compiler.target>11</maven.compiler.target>
1919
<revision>1.0.0-SNAPSHOT</revision>
2020
</properties>
2121

0 commit comments

Comments
 (0)