Skip to content

JDK 25 compatibility - #4

Closed
anamitraupadhyay with Copilot wants to merge 4 commits into
mainfrom
copilot/make-project-jdk25-compatible
Closed

JDK 25 compatibility#4
anamitraupadhyay with Copilot wants to merge 4 commits into
mainfrom
copilot/make-project-jdk25-compatible

Conversation

Copilot AI commented Nov 27, 2025

Copy link
Copy Markdown
Contributor
  • Analyze project structure and understand JDK compatibility requirements
  • Fix settings.gradle to remove non-existent guiceimpl module reference
  • Update lib/build.gradle to support JDK 25 (changed toolchain from 17 to 25)
  • Update lib/build.gradle - upgrade Quarkus BOM to 3.30.1 for JDK 25 compatibility
  • Update Webserver/build.gradle to support JDK 25 (added toolchain configuration)
  • Update Threadimpl/build.gradle to support JDK 25 (added toolchain configuration)
  • Build and test the project with JDK 25 - all 9 tests pass
  • Verify project runs on Linux - demo classes execute successfully
  • Add comprehensive Build & Development documentation to README
  • Update example apps to JDK 25 compatibility:
    • servlet-app: Java 25 toolchain, Quarkus 3.30.1, Gradle 9.0.0, Lombok 1.18.42
    • undertow-app: Java 25 toolchain, Quarkus 3.30.1, Gradle 9.0.0, Lombok 1.18.42
    • spring-app: Java 25 toolchain, Gradle 9.0.0
Original prompt

make the whole project jdk 25 compatible and runnable in linux ore apparently


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Updated lib/build.gradle: Changed Java toolchain from 17 to 25
- Updated lib/build.gradle: Upgraded Quarkus BOM from 3.12.0 to 3.30.1
- Updated Webserver/build.gradle: Added Java 25 toolchain configuration
- Updated Threadimpl/build.gradle: Added Java 25 toolchain configuration
- Fixed settings.gradle: Removed non-existent guiceimpl module reference

Co-authored-by: anamitraupadhyay <128287013+anamitraupadhyay@users.noreply.github.com>
Copilot AI changed the title [WIP] Update project for JDK 25 compatibility on Linux JDK 25 compatibility Nov 27, 2025

@anamitraupadhyay anamitraupadhyay left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

List all the commands serially to run from mavenlocalpublish also if update is required for gradlew or any other list everything

- Added build commands (clean, compile, test, build, publishToMavenLocal)
- Added Maven Local artifact location details
- Added usage instructions for Gradle and Maven dependencies
- Added additional Gradle tasks documentation
- Added Gradle Wrapper update instructions

Co-authored-by: anamitraupadhyay <128287013+anamitraupadhyay@users.noreply.github.com>

Copilot AI commented Nov 27, 2025

Copy link
Copy Markdown
Contributor Author

List all the commands serially to run from mavenlocalpublish also if update is required for gradlew or any other list everything

Added comprehensive Build & Development documentation to README in commit 50ce28a.

Serial build commands:

./gradlew clean
./gradlew compileJava
./gradlew test
./gradlew build
./gradlew :lib:publishToMavenLocal

Or single command:

./gradlew clean build :lib:publishToMavenLocal

Gradle Wrapper - Already at version 9.0.0 (JDK 25 compatible), no update needed. If you need to update:

./gradlew wrapper --gradle-version=9.0.0

Artifacts publish to ~/.m2/repository/io/github/anamitraupadhyay/lib/1.0.0-SNAPSHOT/

@anamitraupadhyay anamitraupadhyay left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@copilot fix the following:
./gradlew quarkusRun
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by net.rubygrapefruit.platform.internal.NativeLibraryLoader in an unnamed module (file:/home/anamitraupadhyay/.gradle/wrapper/dists/gradle-8.7-bin/bhs2wmbdwecv87pi65oeuq5iu/gradle-8.7/lib/native-platform-0.22-milestone-25.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

Starting a Gradle Daemon (subsequent builds will be faster)

Task :quarkusGenerateCode
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by net.rubygrapefruit.platform.internal.NativeLibraryLoader in an unnamed module (file:/home/anamitraupadhyay/.gradle/wrapper/dists/gradle-8.7-bin/bhs2wmbdwecv87pi65oeuq5iu/gradle-8.7/lib/native-platform-0.22-milestone-25.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

Task :compileJava FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileJava'.

Could not resolve all files for configuration ':compileClasspath'.
Could not resolve io.github.anamitraupadhyay:lib:1.0.0-SNAPSHOT.
Required by:
project :
> No matching variant of io.github.anamitraupadhyay:lib:1.0.0-SNAPSHOT was found. The consumer was configured to find a library for use during compile-time, compatible with Java 17, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally but:
- Variant 'apiElements' declares a library for use during compile-time, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component, compatible with Java 25 and the consumer needed a component, compatible with Java 17
- Other compatible attribute:
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
- Variant 'javadocElements' declares a component for use during runtime, and its dependencies declared externally:
- Incompatible because this component declares documentation and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about its elements (required them preferably in the form of class files)
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
- Doesn't say anything about its target Java version (required compatibility with Java 17)
- Variant 'runtimeElements' declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component, compatible with Java 25 and the consumer needed a component, compatible with Java 17
- Other compatible attribute:
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
- Variant 'sourcesElements' declares a component for use during runtime, and its dependencies declared externally:
- Incompatible because this component declares documentation and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about its elements (required them preferably in the form of class files)
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
- Doesn't say anything about its target Java version (required compatibility with Java 17)

  • Try:

Review the variant matching algorithm at https://docs.gradle.org/8.7/userguide/variant_attributes.html#sec:abm_algorithm.
No matching variant errors are explained in more detail at https://docs.gradle.org/8.7/userguide/variant_model.html#sub:variant-no-match.
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.

BUILD FAILED in 1m 2s
4 actionable tasks: 4 executed
anamitraupadhyay@penguin:~/Quarklets/examples/servlet-app$ ./gradlew quarkusDev
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by net.rubygrapefruit.platform.internal.NativeLibraryLoader in an unnamed module (file:/home/anamitraupadhyay/.gradle/wrapper/dists/gradle-8.7-bin/bhs2wmbdwecv87pi65oeuq5iu/gradle-8.7/lib/native-platform-0.22-milestone-25.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

Task :compileJava FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileJava'.

Could not resolve all files for configuration ':compileClasspath'.
Could not resolve io.github.anamitraupadhyay:lib:1.0.0-SNAPSHOT.
Required by:
project :
> No matching variant of io.github.anamitraupadhyay:lib:1.0.0-SNAPSHOT was found. The consumer was configured to find a library for use during compile-time, compatible with Java 17, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally but:
- Variant 'apiElements' declares a library for use during compile-time, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component, compatible with Java 25 and the consumer needed a component, compatible with Java 17
- Other compatible attribute:
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
- Variant 'javadocElements' declares a component for use during runtime, and its dependencies declared externally:
- Incompatible because this component declares documentation and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about its elements (required them preferably in the form of class files)
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
- Doesn't say anything about its target Java version (required compatibility with Java 17)
- Variant 'runtimeElements' declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component, compatible with Java 25 and the consumer needed a component, compatible with Java 17
- Other compatible attribute:
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
- Variant 'sourcesElements' declares a component for use during runtime, and its dependencies declared externally:
- Incompatible because this component declares documentation and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about its elements (required them preferably in the form of class files)
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
- Doesn't say anything about its target Java version (required compatibility with Java 17)

  • Try:

Review the variant matching algorithm at https://docs.gradle.org/8.7/userguide/variant_attributes.html#sec:abm_algorithm.
No matching variant errors are explained in more detail at https://docs.gradle.org/8.7/userguide/variant_model.html#sub:variant-no-match.
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.

BUILD FAILED in 6s
4 actionable tasks: 1 executed, 3 up-to-date
anamitraupadhyay@penguin:~/Quarklets/examples/servlet-app$

- Updated servlet-app: Java 25 toolchain, Quarkus 3.30.1, Gradle 9.0.0, Lombok 1.18.42
- Updated undertow-app: Java 25 toolchain, Quarkus 3.30.1, Gradle 9.0.0, Lombok 1.18.42
- Updated spring-app: Java 25 toolchain, Gradle 9.0.0

Co-authored-by: anamitraupadhyay <128287013+anamitraupadhyay@users.noreply.github.com>

Copilot AI commented Nov 27, 2025

Copy link
Copy Markdown
Contributor Author

@copilot fix the following:
./gradlew quarkusRun
WARNING: A restricted method in java.lang.System has been called...

Fixed in commit 880e360. The issue was that the example apps were using Java 17 while the lib was compiled with Java 25.

Changes made to all example apps:

  • Updated Java toolchain from 17 to 25
  • Updated Gradle wrapper from 8.x to 9.0.0
  • Updated Quarkus from 3.12.0/3.15.7 to 3.30.1
  • Updated Lombok from 1.18.34 to 1.18.42 (required for JDK 25)

To run after publishing lib to Maven Local:

# First, publish lib
cd /path/to/Quarklets
./gradlew clean build :lib:publishToMavenLocal

# Then run servlet-app
cd examples/servlet-app
./gradlew quarkusDev

Note: The undertow-app has pre-existing code issues (unrelated to JDK 25) that need separate fixes.

@anamitraupadhyay anamitraupadhyay left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@copilot
anamitraupadhyay@penguin:~/Quarklets$ # First, publish lib
cd /path/to/Quarklets
./gradlew clean build :lib:publishToMavenLocal

Then run servlet-app

cd examples/servlet-app
./gradlew quarkusDev
-bash: cd: /path/to/Quarklets: No such file or directory
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended

BUILD SUCCESSFUL in 27s
17 actionable tasks: 17 executed
Consider enabling configuration cache to speed up this build: https://docs.gradle.org/9.0.0/userguide/configuration_cache_enabling.html
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by net.rubygrapefruit.platform.internal.NativeLibraryLoader in an unnamed module (file:/home/anamitraupadhyay/.gradle/wrapper/dists/gradle-9.0.0-bin/d6wjpkvcgsg3oed0qlfss3wgl/gradle-9.0.0/lib/native-platform-0.22-milestone-28.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

Task :compileJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

Task :quarkusDev
Listening for transport dt_socket at address: 5005
Press [e] to edit command line args (currently ''), [h] for more options>
Tests paused
Press [e] to edit command line args (currently ''), [r] to resume testing, [h] for more options>
Press [e] to edit command line args (currently ''), [r] to resume testing, [o] Toggle test output, [h] for more options>


--/ __ / / / / _ | / _ / /// / / / __/
-/ /
/ / // / __ |/ , / ,< / // /\ \
--___
// |//|//||_//
2025-11-27 18:11:59,346 INFO [io.quarkus] (Quarkus Main Thread) servlet-app 1.0.0-SNAPSHOT on JVM (powered by Quarkus 3.30.1) started in 16.050s. Listening on: http://localhost:8080
2025-11-27 18:11:59,390 INFO [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2025-11-27 18:11:59,394 INFO [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, servlet, smallrye-context-propagation, vertx]

IDLE
<============-> 92% EXECUTING [3m 51s]
IDLE
IDLE
IDLE
IDLE
IDLE
:quarkusDev
IDLE
IDLE
^Canamitraupadhyay@penguin:~/Quarklets/examples/servlet-app$ ./gradlew quarkusDev
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by net.rubygrapefruit.platform.internal.NativeLibraryLoader in an unnamed module (file:/home/anamitraupadhyay/.gradle/wrapper/dists/gradle-9.0.0-bin/d6wjpkvcgsg3oed0qlfss3wgl/gradle-9.0.0/lib/native-platform-0.22-milestone-28.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

Task :compileJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

Task :quarkusDev
Listening for transport dt_socket at address: 5005
Press [e] to edit command line args (currently ''), [h] for more options>
Tests pausedv
Press [e] to edit command line args (currently ''), [r] to resume testing, [h] for more options>
Press [e] to edit command line args (currently ''), [r] to resume testing, [o] Toggle test output, [h] for more options>


--/ __ / / / / _ | / _ / /// / / / __/
-/ /
/ / // / __ |/ , / ,< / // /\ \
--___
// |//|//||_//
2025-11-27 18:14:12,844 INFO [io.quarkus] (Quarkus Main Thread) servlet-app 1.0.0-SNAPSHOT on JVM (powered by Quarkus 3.30.1) started in 22.365s. Listening on: http://localhost:8080
2025-11-27 18:14:13,133 INFO [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2025-11-27 18:14:13,137 INFO [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, servlet, smallrye-context-propagation, vertx]

:quarkusDev
<============-> 92% EXECUTING [1m 11s]
:quarkusDev
give further details about what's happening

Copilot AI commented Nov 27, 2025

Copy link
Copy Markdown
Contributor Author

@copilot
anamitraupadhyay@penguin:~/Quarklets$ # First, publish lib
cd /path/to/Quarklets...

The servlet-app is running successfully in Quarkus Dev Mode! Here's what's happening:

What you see:

  • Listening on: http://localhost:8080 - The app is running and accepting HTTP requests
  • Live Coding activated - Any code changes you make will be hot-reloaded automatically
  • Listening for transport dt_socket at address: 5005 - Debug port is open for remote debugging

To test the app:

# In another terminal, test the JSON processing endpoint
curl -X POST http://localhost:8080/json/process \
  -H "Content-Type: application/json" \
  -d '{"name": "test", "value": 123}'

Dev Mode controls:

  • Press r - Resume/run tests
  • Press e - Edit command line args
  • Press o - Toggle test output
  • Press h - Show more options
  • Press q or Ctrl+C - Quit

The warnings about "restricted method" are normal JDK 25 warnings from Gradle's native library loader. They don't affect functionality and will be resolved in future Gradle versions.

The JDK 25 compatibility fix is working correctly!

@anamitraupadhyay anamitraupadhyay left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Experimentation done

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.

2 participants