JDK 25 compatibility - #4
Conversation
- 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>
anamitraupadhyay
left a comment
There was a problem hiding this comment.
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>
Added comprehensive Build & Development documentation to README in commit 50ce28a. Serial build commands: ./gradlew clean
./gradlew compileJava
./gradlew test
./gradlew build
./gradlew :lib:publishToMavenLocalOr single command: ./gradlew clean build :lib:publishToMavenLocalGradle Wrapper - Already at version 9.0.0 (JDK 25 compatible), no update needed. If you need to update: ./gradlew wrapper --gradle-version=9.0.0Artifacts publish to |
anamitraupadhyay
left a comment
There was a problem hiding this comment.
@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>
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:
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 quarkusDevNote: The undertow-app has pre-existing code issues (unrelated to JDK 25) that need separate fixes. |
anamitraupadhyay
left a comment
There was a problem hiding this comment.
@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
The servlet-app is running successfully in Quarkus Dev Mode! Here's what's happening: What you see:
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:
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! |
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.