diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 678fb656ec8..85ce445c101 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -9,13 +9,13 @@ jobs: strategy: matrix: os: [ubuntu-22.04, macOS-12, windows-2022] - java: ['11', '17', '21'] + java: ['17', '21'] distribution: ['temurin'] gradle: ['8.10'] include: # Special case to test something close to Debian config with the oldest supported (standard) Gradle on Ubuntu - os: ubuntu-22.04 - java: '11' + java: '17' distribution: 'temurin' gradle: '4.10.3' fail-fast: false diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 03c314a8b34..acde4d994db 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,17 +15,6 @@ reference: paths: - build/** -bullseye-jdk11: - image: debian:bullseye-slim - before_script: - - apt-get update - - apt-get -y install openjdk-11-jdk-headless gradle - script: - - gradle build :bitcoinj-core:publishToMavenLocal :bitcoinj-wallettool:installDist --init-script build-scan-agree.gradle --scan --stacktrace - after_script: - - gradle --version - - sha256sum core/build/libs/*.jar wallettool/build/install/wallet-tool/bin/* wallettool/build/install/wallet-tool/lib/*.jar - bookworm-jdk17: image: debian:bookworm-slim before_script: diff --git a/README.adoc b/README.adoc index a5a198a31ad..7dab39e947d 100644 --- a/README.adoc +++ b/README.adoc @@ -22,7 +22,7 @@ To get started, it is best to have the latest JDK and Gradle installed. The HEAD #### Building from the command line -Official builds are currently using JDK 17. Our GitHub Actions build and test with JDK 11, 17 and 21. +Official builds are currently using JDK 17. Our GitHub Actions build and test with JDK 17 and 21. To perform a full build (_including_ JavaDocs, unit/integration _tests_, and `wallettemplate`) use JDK 17+. diff --git a/settings.gradle b/settings.gradle index 2341a4f5371..2d0f50e22ce 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,6 +2,8 @@ import org.gradle.util.GradleVersion // Minimum Gradle version for build def minGradleVersion = GradleVersion.version("4.4") +// Minimum Gradle version for checking for minimum Java version +def minJavaCheckGradleVersion = GradleVersion.version("6.3") // Minimum Gradle version for JUnit5 def minJunit5GradleVersion = GradleVersion.version("4.6") // Minimum Gradle version for builds of JavaFX 17 module using JDK 17 @@ -14,9 +16,8 @@ rootProject.name = 'bitcoinj-parent' if (GradleVersion.current().compareTo(minGradleVersion) < 0) { throw new GradleScriptException("bitcoinj build requires Gradle ${minGradleVersion} or later", null) } - -if (!JavaVersion.current().isJava11Compatible()) { - throw new GradleScriptException("bitcoinj build requires Java 11 or later", null) +if (GradleVersion.current().compareTo(minJavaCheckGradleVersion) >= 0 && !JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) { + throw new GradleScriptException("bitcoinj build requires Java 17 or later", null) } include 'core' @@ -31,12 +32,12 @@ project(':wallettool').name = 'bitcoinj-wallettool' include 'examples' project(':examples').name = 'bitcoinj-examples' -if (GradleVersion.current().compareTo(minFxGradleVersion) > 0 && JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) { +if (GradleVersion.current().compareTo(minFxGradleVersion) > 0) { System.err.println "Including wallettemplate because ${GradleVersion.current()}" include 'wallettemplate' project(':wallettemplate').name = 'bitcoinj-wallettemplate' } else { - System.err.println "Skipping wallettemplate, requires Gradle ${minFxGradleVersion}+ and Java 17+, currently running Gradle: ${GradleVersion.current()}, Java ${JavaVersion.current()}" + System.err.println "Skipping wallettemplate, requires Gradle ${minFxGradleVersion}+, currently running: ${GradleVersion.current()}" } if (GradleVersion.current().compareTo(minJunit5GradleVersion) >= 0) {