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?
No description
34 Replies
JavaBot
JavaBot4w ago
This post has been reserved for your question.
Hey @Jankins Xingole! Please use /close or the Close 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.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st4w ago
How did you import the project into VSC?
Jankins Xingole
Jankins XingoleOP4w ago
I just import spring framework source code into vscode . I don't know how to configure vscode setting.json.
dan1st
dan1st4w ago
I realized that but how exactly did you do it? Does it show a Java build window?
Jankins Xingole
Jankins XingoleOP4w ago
vscode gradle extension works well
dan1st
dan1st4w ago
Is there something like that on the bottom?
No description
Jankins Xingole
Jankins XingoleOP4w ago
yes but java extension is on the left of gradle.
dan1st
dan1st4w ago
Can you show it?
Jankins Xingole
Jankins XingoleOP4w ago
Yeah! But I need to show it tomorrow because it is on my school's computer.
dan1st
dan1st4w ago
well I can't tell you without you showing me these things but it's fine at any point in time
Jankins Xingole
Jankins XingoleOP4w ago
Thanks for your help.:Duchess:
JavaBot
JavaBot4w ago
💤 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.
Jankins Xingole
Jankins XingoleOP3w ago
Hi, Daniel! My vscode show this errors:
No description
Jankins Xingole
Jankins XingoleOP3w ago
The Java extension reports:
No description
Jankins Xingole
Jankins XingoleOP3w ago
The gradle extension works well:
No description
Jankins Xingole
Jankins XingoleOP3w ago
And my user setting.json is following:
No description
dan1st
dan1st3w ago
Is there a bar at the very bottom of VSC? Can you expand the dependencies of one of the projects with errors?
Jankins Xingole
Jankins XingoleOP3w ago
These actions happen when I start the vscode :
No description
dan1st
dan1st3w ago
click on the "Grafle: configure project" thing What's shown in whatever pops up? What Java version are you using?
Jankins Xingole
Jankins XingoleOP3w ago
I find that the error happens after the initialization of java extension is completed.
dan1st
dan1st3w ago
Can you build it from the CLI?
Jankins Xingole
Jankins XingoleOP3w ago
I use jdk 23 and the gradle extension works well.
Jankins Xingole
Jankins XingoleOP3w ago
No description
dan1st
dan1st3w ago
I guess there is more stuff being shown there afterwards?
Jankins Xingole
Jankins XingoleOP3w ago
The error disappears now.
No description
dan1st
dan1st3w ago
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
Jankins Xingole
Jankins XingoleOP3w ago
It is working for a long time.
No description
dan1st
dan1st3w ago
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
Jankins Xingole
Jankins XingoleOP3w ago
this is the output of gradle extension:
No description
dan1st
dan1st3w ago
Did you set it to JDK 21 or 23? Does it work now after the build completed?
Jankins Xingole
Jankins XingoleOP3w ago
Thanks very much!! When I set it to jdk 21, the errors disappear!!:DukeCheers:
JavaBot
JavaBot3w ago
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.
Jankins Xingole
Jankins XingoleOP3w ago
My friend, you've saved my life!!:DukeWave:
JavaBot
JavaBot3w ago
Post Closed
This post has been closed by <@1317762899896172554>.

Did you find this page helpful?