Skip to content

Commit

Permalink
Bump minimum required Java version to 21 (#12753)
Browse files Browse the repository at this point in the history
Co-authored-by: ChrisHegarty <[email protected]>
Co-authored-by: Dawid Weiss <[email protected]>
Co-authored-by: Robert Muir <[email protected]>
  • Loading branch information
4 people committed Feb 29, 2024
1 parent e7d2bd4 commit 8f17f23
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/actions/prepare-for-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Prepare Lucene build
inputs:
java-version:
required: false
default: 17
default: 21
description: "The default JDK version to set up."

java-distribution:
Expand Down
Empty file.
4 changes: 2 additions & 2 deletions .github/workflows/run-checks-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ]
java: [ '17' ]
java: [ '21' ]

runs-on: ${{ matrix.os }}

Expand All @@ -52,7 +52,7 @@ jobs:
# windows-latest: fairly slow to build and results in odd errors (see LUCENE-10167)
# macos-latest: a tad slower than ubuntu and pretty much the same (?) so leaving out.
os: [ ubuntu-latest ]
java: [ '17' ]
java: [ '21' ]

runs-on: ${{ matrix.os }}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ comprehensive documentation, visit:

### Basic steps:

1. Install OpenJDK 17 or 18.
1. Install OpenJDK 21.
2. Clone Lucene's git repository (or download the source distribution).
3. Run gradle launcher script (`gradlew`).

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ ext {
}

// Minimum Java version required to compile and run Lucene.
minJavaVersion = JavaVersion.VERSION_17
minJavaVersion = JavaVersion.VERSION_21

// snapshot build marker used in scripts.
snapshotBuild = version.contains("SNAPSHOT")
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repositories {

ext {
// Minimum Java version required to compile buildSrc.
minJavaVersion = JavaVersion.VERSION_17
minJavaVersion = JavaVersion.VERSION_21
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public static void main(String[] args) {

public static void checkVersion() {
int major = Runtime.version().feature();
if (major < 17 || major > 21) {
throw new IllegalStateException("java version must be between 17 and 21, your version: " + major);
if (major != 21) {
throw new IllegalStateException("java version must be 21, your version: " + major);
}
}

Expand Down
2 changes: 1 addition & 1 deletion dev-tools/scripts/releaseWizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
from scriptutil import BranchType, Version, download, run

# Lucene-to-Java version mapping
java_versions = {6: 8, 7: 8, 8: 8, 9: 11, 10: 17}
java_versions = {6: 8, 7: 8, 8: 8, 9: 11, 10: 21}
editor = None

# Edit this to add other global jinja2 variables or filters
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/scripts/smokeTestRelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from collections import namedtuple
import scriptutil

BASE_JAVA_VERSION = "17"
BASE_JAVA_VERSION = "21"

# This tool expects to find /lucene off the base URL. You
# must have a working gpg, tar, unzip in your path. This has been
Expand Down
2 changes: 1 addition & 1 deletion gradle/template.gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,5 @@ tests.jvms=@TEST_JVMS@
org.gradle.java.installations.auto-download=true

# Set these to enable automatic JVM location discovery.
org.gradle.java.installations.fromEnv=JAVA17_HOME,JAVA19_HOME,JAVA20_HOME,JAVA21_HOME,JAVA22_HOME,RUNTIME_JAVA_HOME
org.gradle.java.installations.fromEnv=JAVA21_HOME,JAVA22_HOME,RUNTIME_JAVA_HOME
#org.gradle.java.installations.paths=(custom paths)
8 changes: 4 additions & 4 deletions gradle/validation/ecj-lint/ecj.javadocs.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.compliance=21
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
Expand Down Expand Up @@ -143,7 +143,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=error
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=ignore
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=17
org.eclipse.jdt.core.compiler.source=21
org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
org.eclipse.jdt.core.compiler.taskPriorities=HIGH
org.eclipse.jdt.core.compiler.taskTags=nocommit
org.eclipse.jdt.core.compiler.taskTags=nocommit
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ GRADLE_WRAPPER_JAR="$APP_HOME/gradle/wrapper/gradle-wrapper.jar"
"$JAVACMD" $JAVA_OPTS --source 11 "$APP_HOME/buildSrc/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java" "$GRADLE_WRAPPER_JAR"
WRAPPER_STATUS=$?
if [ "$WRAPPER_STATUS" -eq 1 ]; then
echo "ERROR: Something went wrong. Make sure you're using Java version between 17 and 21."
echo "ERROR: Something went wrong. Make sure you're using Java version of exactly 21."
exit $WRAPPER_STATUS
elif [ "$WRAPPER_STATUS" -ne 0 ]; then
exit $WRAPPER_STATUS
Expand Down
2 changes: 1 addition & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ goto fail

:failWithJvmMessage
@rem https://github.com/apache/lucene/pull/819
echo Error: Something went wrong. Make sure you're using Java version between 17 and 21.
echo Error: Something went wrong. Make sure you're using Java version of exactly 21.

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
Expand Down
6 changes: 3 additions & 3 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ Other

* LUCENE-10376: Roll up the loop in VInt/VLong in DataInput. (Guo Feng)

* LUCENE-10283: The minimum required Java version was bumped from 11 to 17.
(Adrien Grand, Uwe Schindler, Dawid Weiss, Robert Muir)

* LUCENE-10253: The @BadApple annotation has been removed from the test
framework. (Adrien Grand)

Expand All @@ -178,6 +175,9 @@ Other

* GITHUB#13001: Put Thread#sleep() on the list of forbidden APIs. (Shubham Chaudhary)

* GITHUB#12753: Bump minimum required Java version to 21
(Chris Hegarty, Robert Muir, Uwe Schindler)

======================== Lucene 9.11.0 =======================

API Changes
Expand Down
2 changes: 1 addition & 1 deletion lucene/SYSTEM_REQUIREMENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# System Requirements

Apache Lucene runs on Java 17 or greater.
Apache Lucene runs on Java 21 or greater.

It is also recommended to always use the latest update version of your
Java VM, because bugs may affect Lucene. An overview of known JVM bugs
Expand Down

0 comments on commit 8f17f23

Please sign in to comment.