Skip to content

Commit 8e9d544

Browse files
mridul111998claude
andauthored
build: upgrade Java source/target compatibility from 8 to 11 (#610)
* build: upgrade Java source/target compatibility from 8 to 11 Java 11 migration has been planned since 2020 (datahub-project/datahub#1699) but was blocked by LinkedIn internally still being on Java 8. That blocker no longer applies — downstream consumers like metadata-graph-assets and metadata-models have moved to Java 17, and metadata-crawlers is on Java 11. This also unblocks a future Elasticsearch upgrade from 7.17.24 to 8.x, which is needed to resolve long-standing ELR validation failures due to CVEs in the ES 7.17.24 dependency (failing since June 2025). Changes: - Set sourceCompatibility/targetCompatibility to 11 in root build.gradle - Update developer docs and roadmap to reflect Java 11 requirement Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * ci: update CI workflows to use JDK 11 Update build-and-test workflow and release action to use JDK 11 instead of JDK 8, matching the new source/target compatibility. Also upgrade actions/setup-java from v1 to v3. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * ci: revert unnecessary setup-java addition in release action The release action uses the runner's default JDK which is already 11+, so explicit setup is not needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7c872d3 commit 8e9d544

5 files changed

Lines changed: 13 additions & 19 deletions

File tree

.github/workflows/build-and-test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ jobs:
2020
runs-on: ubuntu-22.04
2121
steps:
2222
- uses: actions/checkout@v2
23-
- name: Set up JDK 1.8
24-
uses: actions/setup-java@v1
23+
- name: Set up JDK 11
24+
uses: actions/setup-java@v3
2525
with:
26-
java-version: 1.8
26+
java-version: '11'
27+
distribution: 'temurin'
2728
- name: Install lib
2829
run: sudo apt-get install libncurses5
2930

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ platform. It provides type-safe, schema-driven metadata management with event-dr
99
storage backends (SQL via Ebean, Elasticsearch for search). Built on LinkedIn's Pegasus data framework and Rest.li for
1010
REST APIs.
1111

12-
**Java version**: 1.8 (Java 8) — required, newer versions will cause build failures.
12+
**Java version**: 11 (Java 11) — minimum required version.
1313

1414
## Build Commands
1515

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ subprojects { sp ->
139139

140140
afterEvaluate {
141141
if (project.plugins.hasPlugin('java')) {
142-
sourceCompatibility = 1.8
143-
targetCompatibility = 1.8
142+
sourceCompatibility = 11
143+
targetCompatibility = 11
144144
}
145145
}
146146

docs/developers.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,13 @@ For consistency please import and auto format the code using
5656

5757
### Getting `Unsupported class file major version 57`
5858

59-
You're probably using a Java version that's too new for gradle. Run the following command to check your Java version
59+
You're probably using a Java version that's too new for Gradle. Gradle 6.9.4 supports up to JDK 16. Run the following
60+
command to check your Java version
6061

6162
```
6263
java --version
6364
```
6465

65-
While it may be possible to build and run DataHub using newer versions of Java, we currently only support
66-
[Java 1.8](https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html) (aka Java 8). Plan for Java 11
67-
migration is being discussed in [this issue](https://github.com/linkedin/datahub/issues/1699).
68-
69-
### Getting `cannot find symbol` error for `javax.annotation.Generated`
70-
71-
Similar to the previous issue, please use Java 1.8 to build the project.
72-
73-
You can install multiple version of Java on a single machine and switch between them using the `JAVA_HOME` environment
74-
variable. See [this document](https://docs.oracle.com/cd/E21454_01/html/821-2531/inst_jdk_javahome_t.html) for more
75-
details.
66+
This project requires [Java 11](https://adoptium.net/) or later to build. If you have multiple JDK versions installed,
67+
you can switch between them using the `JAVA_HOME` environment variable. See
68+
[this document](https://docs.oracle.com/cd/E21454_01/html/821-2531/inst_jdk_javahome_t.html) for more details.

docs/roadmap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Status: **Draft**
3939
- [ ] Enable `werror` for all Java code.
4040
- [ ] Remove use of tuples library (not idiomatic Java - replace with helper classes / POJOs).
4141
- [x] Elasticsearch 7 support.
42-
- [ ] Java 11 support.
42+
- [x] Java 11 support.
4343

4444
---
4545

0 commit comments

Comments
 (0)