-
Notifications
You must be signed in to change notification settings - Fork 34
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
Incorrect java version getting picked up #224
Comments
This extension doesn't download compiled classes at all. It simply generates a spring boot project.
Check whether java.version is set to 8 in your pom.xml, after the project is created by this extension. If so, then nothing is wrong with this extension. |
java.version is 8 in pom.xml file. Here's the error that I get when I run spring boot application: /usr/bin/env /usr/lib/jvm/java-8-openjdk-amd64/bin/java -cp /tmp/cp_cspnamolxupwt2er09kr4mtub.jar com.example.demo.DemoApplication I didn't get this error, when I manually downloaded project from spring initializr website. |
This problem seems to be due to combination of spring boot version 3.0.0 and java version 8 being incompatible. When I downloaded manually with same combination, the downloaded starter project had java version overriden to 17 which explains why I was able to run the application. Potentially, vscode-spring-initializr can have a feature to detect incompatible spring boot and java version. |
Confirmed the behavior. We use the same endpoint to download the project. Looks like the params are different.
From start.spring.io
From extension: vscode-spring-initializr/src/handler/GenerateProjectHandler.ts Lines 83 to 99 in 7f6bc3a
|
it will be available in next nightly build. You can switch to pre-release version then. |
Seems like vscode-spring-initializr defaults to latest java version, which is 17 as of today. I had selected java version 8. Since, jdk on my local machine is of java 8 and compiled class downloaded by vscode-spring-initialize is of java 17, I was not able to run SpringBootApplication class.
The text was updated successfully, but these errors were encountered: