Skip to content

Commit

Permalink
Use "release" option to fix Java 8 binary compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
marianobarrios committed Jul 6, 2024
1 parent 8263cd5 commit 157b933
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
with:
distribution: 'temurin'
java-version: |
# The target JDK is used to build, the latest one to run Gradle itself
${{ matrix.java-version }}
21
- run: ./gradlew assemble check --info
Expand Down
7 changes: 3 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plugins {
var javaToolchain = System.getenv('JAVA_TOOLCHAIN')

java {
// If running from CI, the tool chain will be present
if (javaToolchain != null) {
toolchain {
languageVersion = JavaLanguageVersion.of(javaToolchain)
Expand All @@ -17,14 +18,12 @@ java {
}

compileJava {
sourceCompatibility = '8'
targetCompatibility = '8'
options.release = 8
options.compilerArgs.add('-Xlint')
}

compileTestJava {
sourceCompatibility = '8'
targetCompatibility = '8'
options.release = 8
options.compilerArgs.add('-Xlint')
}

Expand Down

0 comments on commit 157b933

Please sign in to comment.