Skip to content

Commit ca095a4

Browse files
Also support Java 21 (#743)
Co-authored-by: Ben Madore <ben.madore@glassdoor.com>
1 parent 35435b9 commit ca095a4

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

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 17 11 8
18+
for JVM_VERSION in 21 17 11 8
1919
do
2020
coursier java --jvm $JVM_VERSION --jvm-index https://github.com/coursier/jvm-index/blob/master/index.json -- -version
2121
done

bin/scip-java-docker-script.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# version. It assumes that `coursier` is available on the `$PATH` and that the
44
# `scip-java` binary is already installed at `/app/scip-java/bin/scip-java`.
55
set -eu
6-
JVM_VERSION="${JVM_VERSION:-17,11,8}"
6+
JVM_VERSION="${JVM_VERSION:-21,17,11,8}"
77
FILE="$PWD/lsif-java.json"
88
if test -f "$FILE"; then
99
FROM_CONFIG=$(jq -r '.jvm' "$FILE")
@@ -23,12 +23,11 @@ do
2323
if [ "$LAST_CODE" != "0" ]; then
2424
echo "Using JVM version '$JVM_VERSION'"
2525

26-
if [ "$JVM_VERSION" = "17" ]; then
26+
if [ "$JVM_VERSION" = "17" ] || [ "$JVM_VERSION" = "21" ]; then
2727
export JAVA_OPTS="--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"
2828
else
2929
export JAVA_OPTS=""
3030
fi
31-
3231
eval "$(coursier java --jvm "$JVM_VERSION" --env --jvm-index https://github.com/coursier/jvm-index/blob/master/index.json)"
3332

3433
java -version

docs/getting-started.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ docker run -v $(pwd):/sources --env JVM_VERSION=11 sourcegraph/scip-java:latest
5454

5555
# Java 17 (default)
5656
docker run -v $(pwd):/sources --env JVM_VERSION=17 sourcegraph/scip-java:latest scip-java index
57+
58+
# Java 21
59+
docker run -v $(pwd):/sources --env JVM_VERSION=21 sourcegraph/scip-java:latest scip-java index
60+
5761
```
5862

5963
### Java launcher

0 commit comments

Comments
 (0)