New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested jars are not opened with runtime version set, causing classes in META-INF/versions to be ignored #38050
Comments
Spring's actual Virtual Threads support lives in a multi-release jar (https://openjdk.org/jeps/238), with alternative versions of those classes included for JDK 21+. This works fine for us in common setups. Is this somehow not being picked up in your scenario? |
But I build project with jdk 21 and run project on jdk 21. Should I create multi-release jar only java 21 environment? |
This looks like a regression with our new nested jar loader. For now you can add the following to your build to roll-back to the older implementation:
|
Yes, this solution works. Is my task a duplicate? Should I close it? |
@Hartigan No thanks, we need to fix it in Boot. We'll transfer the issue or create a new one and close this one ourselves. |
I bit of digging shows the assumption that the The code in I think we need to update our archive URLs to include |
Unfortunately appending |
Hello
I tried new version of spring-framework 3.2.0-RC1 with
spring.threads.virtual.enabled=true
feature. But I faced issue with jar provided bybootJar
:java.lang.UnsupportedOperationException: Virtual threads not supported on JDK <21
I prepared minimal reproducible example:
Environment:
openjdk 21 2023-09-19
OpenJDK Runtime Environment (build 21+35)
OpenJDK 64-Bit Server VM (build 21+35, mixed mode, sharing)
Project generated by https://start.spring.io/ with options:
Project: Gradle - Groovy
Language: Java
Spring Boot: 3.2.0-RC1
Packaging: Jar
Java: 21
DemoApplication.java
contents:Output for
./gradlew bootRun
:Output for
./gradlew bootJar && java -jar ./build/libs/demo-0.0.1-SNAPSHOT.jar
:The text was updated successfully, but these errors were encountered: