Skip to content

Commit 7d4a93a

Browse files
authored
Support JDK 24 (#1490)
Fixes #1491 As usual, we verify existing tests don't crash on JDK 24 bytecodes, but we haven't added or tested support for any new features. We update to Gradle 8.14 RC1 as that version supports running on JDK 24. We also shift to using Zulu JDK builds wherever possible. Temurin has enabled JEP 493 for their JDK 24 builds (see adoptium/temurin-build#4035) which means they are distributed without `.jmod` files. This breaks WALA's strategy for loading Java standard library classes from the running VM if no other location is specified. We need to update [the wiki](https://github.com/wala/WALA/wiki/Analysis-Scope) to document this new requirement for JDK 24+ JVMs.
1 parent b2192d2 commit 7d4a93a

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- os: ubuntu-latest
2828
java: 21
2929
- os: ubuntu-latest
30-
java: 23
30+
java: 24
3131
fail-fast: false
3232
runs-on: ${{ matrix.os }}
3333
steps:
@@ -37,7 +37,7 @@ jobs:
3737
uses: actions/setup-java@v4
3838
with:
3939
java-version: ${{ matrix.java }}
40-
distribution: 'temurin'
40+
distribution: 'zulu'
4141
- name: Setup Gradle
4242
uses: gradle/actions/setup-gradle@v4
4343
- name: Build and test using Gradle with ECJ
@@ -73,7 +73,7 @@ jobs:
7373
if: github.event_name == 'push' && github.repository == 'wala/WALA' && github.ref == 'refs/heads/master'
7474
runs-on: ubuntu-latest
7575
env:
76-
JDK_VERSION: 23
76+
JDK_VERSION: 24
7777
steps:
7878
- name: 'Check out repository'
7979
uses: actions/checkout@v4

build-logic/src/main/kotlin/com/ibm/wala/gradle/java.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package com.ibm.wala.gradle
33
// Build configuration for subprojects that include Java source code.
44

55
import net.ltgt.gradle.errorprone.errorprone
6+
import org.gradle.jvm.toolchain.JvmVendorSpec
67

78
plugins {
89
eclipse
@@ -25,6 +26,9 @@ repositories {
2526

2627
java.toolchain.languageVersion =
2728
JavaLanguageVersion.of(property("com.ibm.wala.jdk-version") as String)
29+
// We prefer a toolchain that includes jmod files for the Java standard library, like Azul Zulu.
30+
// Temurin does not include jmod files as of their JDK 24 builds.
31+
java.toolchain.vendor = JvmVendorSpec.AZUL
2832

2933
base.archivesName = "com.ibm.wala${path.replace(':', '.')}"
3034

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ gradle-goomph-plugin = "com.diffplug.gradle:goomph:3.44.0"
2323
gradle-maven-publish-plugin = "com.vanniktech:gradle-maven-publish-plugin:0.29.0"
2424
gradle-spotless-plugin = { module = "com.diffplug.spotless:spotless-plugin-gradle", version.ref = "spotless" }
2525
gson = "com.google.code.gson:gson:2.11.0"
26-
guava = "com.google.guava:guava:33.4.5-jre"
26+
guava = "com.google.guava:guava:33.4.8-jre"
2727
hamcrest = "org.hamcrest:hamcrest:2.2"
2828
htmlparser = "nu.validator.htmlparser:htmlparser:1.4"
2929
java_cup = "java_cup:java_cup:0.9e"

shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/ClassReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ private void parse() throws InvalidClassFileException {
6767
if (magic != MAGIC) {
6868
throw new InvalidClassFileException(offset, "bad magic number: " + magic);
6969
}
70-
// Support class files up through JDK 23 (version 67)
71-
if (majorVersion < 45 || majorVersion > 67) {
70+
// Support class files up through JDK 24 (version 68)
71+
if (majorVersion < 45 || majorVersion > 68) {
7272
throw new InvalidClassFileException(
7373
offset, "unknown class file version: " + majorVersion + '.' + minorVersion);
7474
}

0 commit comments

Comments
 (0)