Skip to content

Commit a06e3a3

Browse files
committed
[KYUUBI #7289] Release requires Java 17 or 21
### Why are the changes needed? I hit an issue while preparing 1.11.0 RC0, which indicates I need to use a higher version of JDK for releasing. ``` [INFO] --- antlr4:4.13.1:antlr4 (default) kyuubi-extension-spark-4-0_2.13 --- [WARNING] Error injecting: org.antlr.mojo.antlr4.Antlr4Mojo java.lang.UnsupportedClassVersionError: org/antlr/v4/Tool has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 at java.lang.ClassLoader.defineClass1 (Native Method) at java.lang.ClassLoader.defineClass (ClassLoader.java:756) at java.security.SecureClassLoader.defineClass (SecureClassLoader.java:142) ``` In #7144, we made it always use `-release:8` for `jdk9+`, so we still produce Java 8 compatible bytecode even using JDK 17, for all modules except Spark 4.0/4.1 extension modules. ### How was this patch tested? Will verify this in the next RC of 1.11.0 ### Was this patch authored or co-authored using generative AI tooling? No. Closes #7289 from pan3793/release-java17. Closes #7289 17e29be [Cheng Pan] Release requires Java 17 or 21 Authored-by: Cheng Pan <chengpan@apache.org> Signed-off-by: Cheng Pan <chengpan@apache.org> (cherry picked from commit eecdaaa) Signed-off-by: Cheng Pan <chengpan@apache.org>
1 parent 9d2930f commit a06e3a3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

build/release/release.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ else
6262
fi
6363

6464
JAVA_VERSION=$($JAVA -version 2>&1 | awk -F '"' '/version/ {print $2}')
65-
if [[ $JAVA_VERSION != 1.8.* ]]; then
66-
echo "Unexpected Java version: $JAVA_VERSION. Java 8 is required for release."
65+
if [[ $JAVA_VERSION != 17.* && $JAVA_VERSION != 21.* ]]; then
66+
echo "Unexpected Java version: $JAVA_VERSION. Java 17 or 21 is required for release."
6767
exit 1
6868
fi
6969

docs/contributing/code/release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export ASF_PASSWORD=<your apache password>
9090
#### Java Home
9191

9292
An available environment variable `JAVA_HOME`, you can do `echo $JAVA_HOME` to check it.
93-
Note that, the Java version should be 8.
93+
Note that, the Java 17 or 21 is required since 1.11.0, for earlier versions, it requires Java 8.
9494

9595
#### Subversion
9696

0 commit comments

Comments
 (0)