Vscode Java Extension Errors But Gradle Extension Works Well
I want to read the spring framework source code and am ready to build up the environment in vscode. However, I confronted with the configuration errors. Why the vscode cann't resolve the class in gradle repo?
34 Replies
⌛
This post has been reserved for your question.
Hey @Jankins Xingole! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
How did you import the project into VSC?
I just import spring framework source code into vscode . I don't know how to configure vscode setting.json.
I realized that but how exactly did you do it?
Does it show a Java build window?
vscode gradle extension works well
Is there something like that on the bottom?
yes
but java extension is on the left of gradle.
Can you show it?
Yeah! But I need to show it tomorrow because it is on my school's computer.
well I can't tell you without you showing me these things
but it's fine at any point in time
Thanks for your help.:Duchess:
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
Hi, Daniel! My vscode show this errors:
The Java extension reports:
The gradle extension works well:
And my user setting.json is following:
Is there a bar at the very bottom of VSC?
Can you expand the dependencies of one of the projects with errors?
These actions happen when I start the vscode :
click on the "Grafle: configure project" thing
What's shown in whatever pops up?
What Java version are you using?
I find that the error happens after the initialization of java extension is completed.
Can you build it from the CLI?
I use jdk 23 and the gradle extension works well.
I guess there is more stuff being shown there afterwards?
The error disappears now.
Is there anything more shown in the gradle build output if you wait?
Seems like VSC uses JDK 17 for the Gradle build - idk whether Spring allows that
or maybe even a JRE
It is working for a long time.
you might want to try setting set Gradle JVM to your Java 23 JDK explicitly
or JDK 21 should work as well
check the settings in VSC
this is the output of gradle extension:
Did you set it to JDK 21 or 23?
Does it work now after the build completed?
Thanks very much!! When I set it to jdk 21, the errors disappear!!:DukeCheers:
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
My friend, you've saved my life!!:DukeWave:
Post Closed
This post has been closed by <@1317762899896172554>.