Skip to content

Migrate from Java 8 to Java 11 (LTS) - #32

Open
devin-ai-integration[bot] wants to merge 5 commits into
masterfrom
devin/java8-to-11
Open

devin-ai-integration[bot] wants to merge 5 commits into
masterfrom
devin/java8-to-11

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented May 15, 2026 •

Copy link
Copy Markdown

Summary

Minimal, behavior-preserving migration of springboot-java8 from Java 8 to Java 11 (LTS). The Maven and Gradle builds now target Java 11, a GitHub Actions CI builds both on Temurin JDK 11, and docs are added/updated. No application source changed — a source scan found no removed JDK modules (JAXB / JAX-WS / JavaFX / CORBA / Nashorn / sun.misc), so no replacement dependencies were needed.

The key non-obvious change: the Maven build declared <packaging>pom</packaging>, so it never compiled or tested the hello.* sources — mvn package "passed" while producing no classes. Switching to jar is what makes the Java 11 --release actually apply and the migration verifiable.

Build

Maven (pom.xml) — canonical build:

  • pom → jar packaging so compile / test / repackage actually run.
  • Dropped <java.version>1.8</java.version>; added maven.compiler.release=11 and UTF-8 source/reporting encoding.
  • maven-compiler-plugin 3.11.0 with <release>11</release> and -Xlint:all -Werror (source is warning-clean).
  • maven-surefire-plugin 3.2.5, maven-failsafe-plugin 3.2.5, maven-javadoc-plugin 3.6.3 (doclint off), maven-enforcer-plugin 3.5.0 with requireJavaVersion [11,).
  • Added spring-boot-starter-test (test scope).
  • Maven wrapper 3.3.9 → 3.9.9 (surefire/enforcer 3.x require Maven ≥ 3.6.3).

Gradle (build.gradle) — secondary build:

  • Wrapper 4.6 → 6.9.4 (4.6 cannot run on JDK 11).
  • Replaced sourceCompatibility/targetCompatibility = 1.8 with a Java toolchain pinned to 11 (Gradle rejects combining a project toolchain with source/target compatibility).
  • Modernized compile/testCompile → implementation/testImplementation.
  • Parity fix: added spring-boot-starter-jdbc + h2 — the Gradle build only declared starter-web and failed to compile Application (JdbcTemplate) even on Java 8. These already exist in pom.xml.
- <packaging>pom</packaging>          + <packaging>jar</packaging>
- <java.version>1.8</java.version>    + <maven.compiler.release>11</maven.compiler.release>

Removals / Replacements

None. No usages of removed JDK modules were found, so no JAXB/JAX-WS/JavaFX/Activation deps were added.

Encapsulation

Built on the classpath (no module-info.java). No --add-opens needed — the application produces no illegal-reflective-access warnings on JDK 11. (Gradle 6.9.4's own Groovy runtime prints such a warning during the build; that is Gradle itself, not project code.)

Security / GC

No TLS config, keystores, certs, or custom GC/JVM flags exist in the repo, so Java 11 defaults (TLS 1.3, PKCS12, G1, unified logging) apply with no changes.

Validation

  • ./mvnw -B -e clean verify (JDK 11) → BUILD SUCCESS; enforcer RequireJavaVersion passed; Compiling 13 source files with javac [debug release 11]; surefire No tests to run; spring-boot:repackage succeeded.
  • ./gradlew --no-daemon clean build (JDK 11) → BUILD SUCCESSFUL.
  • App boots on JDK 11 (Tomcat on :8080, Spring context started). Note: the startup CommandLineRunner then calls an external quotes endpoint (gturnquist-quoters.cfapps.io) that is no longer reachable and exits — pre-existing, network-related, identical on Java 8, unrelated to the migration.
  • CI added: .github/workflows/ci.yml — actions/setup-java@v4 (Temurin 11) with two jobs: Maven (./mvnw -B -e clean verify, cache: maven) and Gradle (./gradlew --no-daemon clean build, cache: gradle).
  • Housekeeping: stopped tracking committed target/ classes; ignore target/, build/, .gradle/.

Follow-ups (out of scope)

  • Upgrade Spring Boot to 2.1+/2.7.x for officially supported JDK 11 runtime (2.0.2 / Spring 5.0 predate it; compiles/packages fine on 11).
  • Add an actual test suite (@SpringBootTest smoke test) so CI verifies runtime behavior.
  • Move Gradle to 7/8 + plugins DSL (requires the Spring Boot upgrade; the 2.0.2 plugin is incompatible with Gradle 7+).

See MIGRATION_NOTES.md for full details.

Link to Devin session: https://app.devin.ai/sessions/ddd71375f7aa4b8fbbedff65360ba605
Requested by: @TheWuster935


Devin Review

Status Commit
🟢 Reviewed e8215b7
Open in Devin Review (Staging)

@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot changed the title chore: migrate from Java 8 to Java 11 Migrate from Java 8 to Java 11 May 21, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

staging-devin-ai-integration[bot]

This comment was marked as resolved.

@devin-ai-integration

Copy link
Copy Markdown
Author

Testing Results: Java 8 → Java 11 Migration

Method: Started app with java -jar using JDK 11.0.30, tested all REST endpoints via curl.
Session: https://app.devin.ai/sessions/48775aa1ead249a281281f3bacae8968

Escalations

None — all tests passed.

Test Results (9/9 passed)
# Test Result
1 App starts on Java 11 (no ClassNotFoundException, JAXB errors, or circular ref errors) PASSED
2 GET / returns {"id":1,"content":"Hello, World!"} PASSED
3 GET /topic returns 3 hardcoded topics (spring, java, javascript) PASSED
4 POST /topic + GET /topic/python round-trips correctly PASSED
5 GET /topic/sort returns alphabetical order (java < javascript < python < spring) PASSED
6 GET /datetime returns timezone-aware datetime with Canada/Central zone PASSED
7 GET /topic/string/operation returns joined IDs and pattern-filtered results PASSED
8 H2 database seeding inserts 4 customers, JdbcTemplate query returns 2 Josh records PASSED
9 Startup log confirms Java 11.0.30 runtime PASSED
Startup Evidence
:: Spring Boot ::               (v2.6.15)
Starting Application v0.1.0 using Java 11.0.30
Started Application in 2.118 seconds
Inserting customer record for John Woo
Inserting customer record for Jeff Dean
Inserting customer record for Josh Bloch
Inserting customer record for Josh Long
Customer{id=3, firstName='Josh', lastName='Bloch'}
Customer{id=4, firstName='Josh', lastName='Long'}
Endpoint Evidence
GET / → {"id":1,"content":"Hello, World!"}
GET /topic → [spring, java, javascript] (3 topics)
POST+GET /topic/python → round-trip matches
GET /topic/sort → [java, javascript, python, spring]
GET /datetime → ...Time in California: 2026-05-21T01:00:46-05:00[Canada/Central]
GET /topic/string/operation → java:javascript:python:spring (joined + filtered)

devin-ai-integration[bot]

This comment was marked as resolved.

staging-devin-ai-integration[bot]

This comment was marked as resolved.

@devin-ai-integration

Copy link
Copy Markdown
Author

Devin is archived and cannot be woken up. Please unarchive Devin if you want to continue using it.

@devin-ai-integration devin-ai-integration Bot changed the title Migrate from Java 8 to Java 11 feat: Migrate from Java 8 to Java 11 May 26, 2026
staging-devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot changed the title feat: Migrate from Java 8 to Java 11 Migrate from Java 8 to Java 11 (LTS) Jun 1, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

@staging-devin-ai-integration staging-devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 4 new potential issues.

View 3 additional findings in Devin Review.

Open in Devin Review (Staging)
Debug

Playground

Comment thread pom.xml Resolved
Comment thread mvnw.cmd Resolved
Comment thread .github/workflows/ci.yml Outdated
Comment on lines +23 to +24
- name: Build and test (Maven)
run: ./mvnw -B clean verify

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 CI only verifies packaging, not that the migrated application starts

The new workflow runs ./mvnw -B clean verify, but there are no tests and the Maven lifecycle stops after packaging; it does not execute the generated Boot jar or load the Spring application context. Given Application.main and both CommandLineRunner paths perform startup work including external HTTP calls and JDBC initialization (src/main/java/hello/Application.java:38-55 and src/main/java/hello/Application.java:62-87), CI can be green while runtime startup is still broken. This is worth following up with a smoke test or a startup mode that disables external network calls during CI.

Open in Devin Review (Staging)

Was this helpful? React with 👍 or 👎 to provide feedback.

Debug

Playground

zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip

@staging-devin-ai-integration staging-devin-ai-integration Bot Jun 1, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Wrapper JARs not updated alongside distribution version bumps

Both gradle-wrapper.jar and maven-wrapper.jar remain unchanged from the original project (Gradle 4.6 era / Maven 3.3.9 era), while the distribution URLs were bumped to Gradle 6.9.4 and Maven 3.9.9. The old wrapper JARs should still function—their primary job is downloading the specified distribution—but they lack newer features and bug fixes. The wrapperUrl property added in .mvn/wrapper/maven-wrapper.properties:3 pointing to maven-wrapper-3.3.2.jar will be ignored by the old wrapper JAR since it predates that feature. Best practice is to regenerate wrapper JARs when upgrading (e.g., gradle wrapper --gradle-version 6.9.4 and mvn wrapper:wrapper -Dmaven=3.9.9).

Open in Devin Review (Staging)

Was this helpful? React with 👍 or 👎 to provide feedback.

Debug

Playground

devin-ai-integration Bot and others added 5 commits June 15, 2026 21:55
…gins

- maven-compiler-plugin 3.11.0 with <release>11</release>, -Xlint:all -Werror
- surefire/failsafe 3.2.5, javadoc 3.6.3, enforcer 3.5.0 requireJavaVersion [11,)
- packaging pom -> jar so sources compile and repackage on JDK 11
- upgrade Maven wrapper 3.3.9 -> 3.9.9

Co-Authored-By: derek.wu <derekwu35@gmail.com>
…Gradle cache

Co-Authored-By: derek.wu <derekwu35@gmail.com>
Co-Authored-By: derek.wu <derekwu35@gmail.com>
Co-Authored-By: derek.wu <derekwu35@gmail.com>

@staging-devin-ai-integration staging-devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

Open in Devin Review (Staging)
Debug

Playground

Comment thread pom.xml

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Spring Boot 2.0.2 predates official Java 11 support

The PR acknowledges this in MIGRATION_NOTES.md:104-106, but it's worth noting as a reviewer: Spring Boot 2.0.x was EOL before Java 11 GA. While the build compiles cleanly on JDK 11, runtime behavior (especially Spring Framework 5.0's reflection and proxy internals) may exhibit subtle issues on JDK 11+ that are fixed in Spring Boot 2.1+. The -Xlint:all -Werror flags and the enforcer plugin help catch compile-time issues, but they don't guard against runtime incompatibilities. The project currently has zero tests, so there's no runtime validation in CI.

(Refers to line 14)

Open in Devin Review (Staging)

Was this helpful? React with 👍 or 👎 to provide feedback.

Debug

Playground

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 new potential issues.

Open in Devin Review

Comment thread pom.xml

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Spring Boot 2.0.2 predates official JDK 11 support

The PR migrates to Java 11 but retains Spring Boot 2.0.2.RELEASE (pom.xml:14, build.gradle:6). Spring Boot 2.0.x / Spring Framework 5.0.x did not officially support JDK 11 — that was added in Spring Boot 2.1.x. While the build compiles and packages cleanly (as noted in MIGRATION_NOTES.md), there may be subtle runtime issues (e.g., reflection warnings, internal API usage) that only manifest at runtime under JDK 11. The PR author correctly documents this as a follow-up item in MIGRATION_NOTES.md:101-104, but reviewers should be aware this is a known gap in the migration.

(Refers to line 14)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acknowledged and intentional. This PR is scoped to the Java 8 → 11 toolchain/CI migration with minimal behavior change, so the framework version is deliberately held at Spring Boot 2.0.2. It compiles, packages, and boots on JDK 11 (the Spring context starts; the only startup failure is a pre-existing call to a now-dead external quotes endpoint, identical on Java 8). The Spring Boot 2.1+/2.7.x upgrade for officially-supported JDK 11 runtime is called out as a follow-up in MIGRATION_NOTES.md and the PR description.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Gradle wrapper script lacks executable permission (pre-existing)

The gradlew script is tracked with git mode 100644 (not executable), while mvnw is correctly 100755. Running ./gradlew clean build on Linux/macOS would fail with a permission error unless chmod +x is applied first. This is a pre-existing issue (not introduced by this PR), but the PR does modify the Gradle wrapper properties and documents ./gradlew clean build as a valid build command in README.md:92, making it more likely someone will hit this.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in this branch — gradlew is now tracked with mode 100755 (executable), matching mvnw:

$ git ls-tree HEAD gradlew mvnw
100755 blob ... gradlew
100755 blob ... mvnw

The Gradle CI job (./gradlew --no-daemon clean build) runs the wrapper directly without a chmod step and passes, confirming the executable bit is set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant