From 74bc45b945d299e5118137efc81fe2ec0c244779 Mon Sep 17 00:00:00 2001 From: Sean Gilligan Date: Sun, 25 Aug 2024 12:59:34 -0700 Subject: [PATCH] Require JDK 17 or later to build --- .github/workflows/gradle.yml | 2 +- CHANGELOG.adoc | 3 ++- README.adoc | 2 +- settings.gradle | 10 +++------- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 3964347d..6a5b499f 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macOS-latest, windows-latest] - java: ['11', '17', '21'] + java: ['17', '21'] distribution: ['temurin'] fail-fast: false name: ${{ matrix.os }} JDK ${{ matrix.java }} diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index bbfb12c5..70a5435c 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -19,8 +19,9 @@ Released: in-progress === Build/Test Updates +* Require JDK 17 or later to build * Gradle 8.10 -* GitHub `gradle.yml` JDK Matrix: Java 11, 17, **21** (was `21-ea`) +* GitHub `gradle.yml` JDK Matrix: Java 17, 21 * Asciidoctor Gradle Plugin 4.0.1 == v0.7.0-alpha3 diff --git a/README.adoc b/README.adoc index fe614787..b1379b00 100644 --- a/README.adoc +++ b/README.adoc @@ -435,7 +435,7 @@ The `#consensusj-exchange` module includes an adapter class `BaseXChangeExchange == Building and Running -Before running `./gradlew` wrapper script you must have JDK 11 installed and your `JAVA_HOME` set correctly. To build native images you'll need a GraalVM JDK 11 with the `native-image` tool installed via `gu install native-image`. +Before running `./gradlew` wrapper script you must have JDK 17 or later installed and your `JAVA_HOME` set correctly. To build native images you'll need a GraalVM JDK 17 or later with the `native-image` tool installed via `gu install native-image`. NOTE: The first time you run the build all dependency JARS will be downloaded. diff --git a/settings.gradle b/settings.gradle index 6e111fb2..101e223b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,8 +4,8 @@ plugins { rootProject.name = 'consensusj' -if (!JavaVersion.current().isJava11Compatible()) { - throw new RuntimeException("JDK 11 Required to compile ConsensusJ") +if (JavaVersion.current().compareTo(JavaVersion.VERSION_17) < 0) { + throw new RuntimeException("JDK 17 or later is required to compile ConsensusJ") } // JDK 8 @@ -32,17 +32,13 @@ if (!JavaVersion.current().isJava11Compatible()) { include 'cj-eth-jsonrpc' // Ethereum JSON-RPC client (experimental) include 'cj-nmc-jsonrpc' // Namecoin JSON-RPC client (experimental) -if (JavaVersion.current().compareTo(JavaVersion.VERSION_17) >= 0) { - System.err.println "Including JDK 17 modules because Java is ${JavaVersion.current()}" +// JDK 17 include 'consensusj-jsonrpc-daemon' // JSON-RPC sample server include 'cj-bitcoinj-spock' // Spock tests/demos of basic bitcoinj capabilities include 'cj-bitcoinj-dsl-js' // JavaScript DSL for bitcoinj via Nashorn include 'cj-btc-daemon' // Prototype Micronaut version of Bitcoin daemon include 'cj-btc-jsonrpc-integ-test' // RPC-based integration tests of/using bitcoind include 'cj-btc-services' // bitcoinj-based service objects -} else { - System.err.println "Skipping JDK 17 modules, currently running Java ${JavaVersion.current()}" -} if (JavaVersion.current().compareTo(JavaVersion.VERSION_21) >= 0) { System.err.println "Including JDK 21 modules because Java is ${JavaVersion.current()}"