diff --git a/.github/actions/prepare-for-build/action.yml b/.github/actions/prepare-for-build/action.yml index 1df2a44b634..92e751f60bb 100644 --- a/.github/actions/prepare-for-build/action.yml +++ b/.github/actions/prepare-for-build/action.yml @@ -6,7 +6,7 @@ name: Prepare Lucene build inputs: java-version: required: false - default: 21 + default: 17 description: "The default JDK version to set up." java-distribution: diff --git a/.github/workflows/distribution.yml b/.github/workflows/distribution.yml deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.github/workflows/run-checks-all.yml b/.github/workflows/run-checks-all.yml index 3f899903dce..98248c9ad7d 100644 --- a/.github/workflows/run-checks-all.yml +++ b/.github/workflows/run-checks-all.yml @@ -29,7 +29,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - java: [ '21' ] + java: [ '17' ] runs-on: ${{ matrix.os }} @@ -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: [ '21' ] + java: [ '17' ] runs-on: ${{ matrix.os }} diff --git a/README.md b/README.md index 7a167e7455d..d8ff9234044 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ comprehensive documentation, visit: ### Basic steps: -1. Install OpenJDK 21. +1. Install OpenJDK 17 or 18. 2. Clone Lucene's git repository (or download the source distribution). 3. Run gradle launcher script (`gradlew`). diff --git a/build.gradle b/build.gradle index 309e903c5b2..5196488a885 100644 --- a/build.gradle +++ b/build.gradle @@ -73,7 +73,7 @@ ext { } // Minimum Java version required to compile and run Lucene. - minJavaVersion = JavaVersion.VERSION_21 + minJavaVersion = JavaVersion.VERSION_17 // snapshot build marker used in scripts. snapshotBuild = version.contains("SNAPSHOT") diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index db63485924d..9879caa8e18 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -21,7 +21,7 @@ repositories { ext { // Minimum Java version required to compile buildSrc. - minJavaVersion = JavaVersion.VERSION_21 + minJavaVersion = JavaVersion.VERSION_17 } diff --git a/buildSrc/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java b/buildSrc/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java index 1122030a29a..133216b46f0 100644 --- a/buildSrc/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java +++ b/buildSrc/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java @@ -55,8 +55,8 @@ public class WrapperDownloader { public static void checkVersion() { int major = Runtime.version().feature(); - if (major != 21) { - throw new IllegalStateException("java version must be 21, your version: " + major); + if (major < 17 || major > 21) { + throw new IllegalStateException("java version must be between 17 and 21, your version: " + major); } } diff --git a/dev-tools/scripts/releaseWizard.py b/dev-tools/scripts/releaseWizard.py index 562abf8f6e7..2fe72a65f2c 100755 --- a/dev-tools/scripts/releaseWizard.py +++ b/dev-tools/scripts/releaseWizard.py @@ -66,7 +66,7 @@ from consolemenu.items import FunctionItem, SubmenuItem, ExitItem from scriptutil import BranchType, Version, download, run # Lucene-to-Java version mapping -java_versions = {6: 8, 7: 8, 8: 8, 9: 11, 10: 21} +java_versions = {6: 8, 7: 8, 8: 8, 9: 11, 10: 17} editor = None # Edit this to add other global jinja2 variables or filters diff --git a/dev-tools/scripts/smokeTestRelease.py b/dev-tools/scripts/smokeTestRelease.py index 87e70adbb1f..69833663c81 100755 --- a/dev-tools/scripts/smokeTestRelease.py +++ b/dev-tools/scripts/smokeTestRelease.py @@ -39,7 +39,7 @@ import zipfile from collections import namedtuple import scriptutil -BASE_JAVA_VERSION = "21" +BASE_JAVA_VERSION = "17" # This tool expects to find /lucene off the base URL. You # must have a working gpg, tar, unzip in your path. This has been diff --git a/gradle/template.gradle.properties b/gradle/template.gradle.properties index 60486b86967..9ac8c42e9dd 100644 --- a/gradle/template.gradle.properties +++ b/gradle/template.gradle.properties @@ -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=JAVA21_HOME,JAVA22_HOME,RUNTIME_JAVA_HOME +org.gradle.java.installations.fromEnv=JAVA17_HOME,JAVA19_HOME,JAVA20_HOME,JAVA21_HOME,JAVA22_HOME,RUNTIME_JAVA_HOME #org.gradle.java.installations.paths=(custom paths) diff --git a/gradle/validation/ecj-lint/ecj.javadocs.prefs b/gradle/validation/ecj-lint/ecj.javadocs.prefs index 6da3899a27f..813aa7fe4cc 100644 --- a/gradle/validation/ecj-lint/ecj.javadocs.prefs +++ b/gradle/validation/ecj-lint/ecj.javadocs.prefs @@ -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=21 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=21 +org.eclipse.jdt.core.compiler.compliance=17 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -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=21 +org.eclipse.jdt.core.compiler.source=17 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 \ No newline at end of file diff --git a/gradlew b/gradlew index 8765922447e..c4770259bf7 100755 --- a/gradlew +++ b/gradlew @@ -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 of exactly 21." + echo "ERROR: Something went wrong. Make sure you're using Java version between 17 and 21." exit $WRAPPER_STATUS elif [ "$WRAPPER_STATUS" -ne 0 ]; then exit $WRAPPER_STATUS diff --git a/gradlew.bat b/gradlew.bat index 23a9b785a93..ca7ae1a1741 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -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 of exactly 21. +echo Error: Something went wrong. Make sure you're using Java version between 17 and 21. :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index be9033a6745..f0029a52e7f 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -153,6 +153,9 @@ 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) @@ -175,9 +178,6 @@ 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 diff --git a/lucene/SYSTEM_REQUIREMENTS.md b/lucene/SYSTEM_REQUIREMENTS.md index 5a96b411fbc..b158d16b1c4 100644 --- a/lucene/SYSTEM_REQUIREMENTS.md +++ b/lucene/SYSTEM_REQUIREMENTS.md @@ -17,7 +17,7 @@ # System Requirements -Apache Lucene runs on Java 21 or greater. +Apache Lucene runs on Java 17 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