GithubHelp home page GithubHelp logo

Comments (5)

win301 avatar win301 commented on June 12, 2024 1

@ov7a I see. Thank you very much for your reply. It turned out to be a problem with Springboot, but I always thought it was a problem with Gradle. I adopted this method and successfully resolved the issue of bootJar running an error。

This can be worked around by configuring the application's main class name:

springBoot {
mainClass = 'com.example.ExampleApplication'
}

Because I am using gradle kotlin, the code above is written in this way

tasks.bootJar {
mainClass="com.example.ExampleApplication"
// other config code
}

from gradle.

whydoievenneedthis avatar whydoievenneedthis commented on June 12, 2024

I have the same error, and it finishes up with this message:

Unsupported Gradle JVM.

Your build is currently configured to use Java 22.0.1 and Gradle 8.8-rc-1.

Possible solutions:
 - Use Java 21 as Gradle JVM: Open Gradle settings
 - Upgrade to Gradle 8.5 and re-sync

Interestingly enough, when I run the test suite it works fine -- once:

> Task :compileJava
Note: C:\xxx.java uses preview features of Java SE 22.
Note: Recompile with -Xlint:preview for details.
> Task :processResources UP-TO-DATE
> Task :classes
> Task :compileTestJava
Note: C:\yyy.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\zzz.java uses preview features of Java SE 22.
Note: Recompile with -Xlint:preview for details.

When I try to re-run the test suite a second time, I get a "Test events were not received" message, and this persists until I switch back to Java 21.

from gradle.

ov7a avatar ov7a commented on June 12, 2024

We appreciate the effort, but we must ask for more information so that we can triage it.

We do not see an immediate root cause, and we need a minimal reproducible example for the triage. If we have a reproducer, we may be able also to suggest workarounds or ways to avoid the problem.

The ideal way to provide a reproducer is to leverage our reproducer template. You can also use Gradle Project Replicator to reproduce the structure of your project.

This issue will be closed after 7 days unless you provide more information.


There are multiple moving parts here.

  1. Spring boot gradle plugin. Does the version you are using support running on Java 22?
  2. Intellij support. Does the version you are using support integration with Gradle 8.8-rc-1?

In any case, please provide a reproducer for your issue.

from gradle.

win301 avatar win301 commented on June 12, 2024

@ov7a I have attached a demo of Springboot for you, which uses the gradle-8.8-rc-1 version. The version of Springboot is the latest preview version, version 3.3.0 RC1 (of course, using the latest official version 3.2.5, the result is the same). Both versions of Springboot support JDK22, and the Intellij idea version I am currently using is 2024.1, which is also the latest version.
sprinboot-3.3.0 (RC1).zip

from gradle.

ov7a avatar ov7a commented on June 12, 2024

The stacktrace

...
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 66
        at org.springframework.asm.ClassReader.<init>(ClassReader.java:199)
        at org.springframework.asm.ClassReader.<init>(ClassReader.java:180)
        at org.springframework.asm.ClassReader.<init>(ClassReader.java:166)
        at org.springframework.asm.ClassReader.<init>(ClassReader.java:287)
        at org.springframework.boot.loader.tools.MainClassFinder.createClassDescriptor(MainClassFinder.java:254)
        at org.springframework.boot.loader.tools.MainClassFinder.doWithMainClasses(MainClassFinder.java:136)
        at org.springframework.boot.loader.tools.MainClassFinder.findSingleMainClass(MainClassFinder.java:109)
...

indicates that it's a Spring issue.

See these issues for more details:

from gradle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.