6

Hi I'm new to java and keep getting this error on and on in vs code. How do I solve this?

1
  • by putting the file on the classpath. You should also adopt naming conventions Commented Apr 27, 2021 at 8:37

4 Answers 4

11

Press "Ctrl + Shift + P", choose "java : Clean java Language Server workspace". If not run, right click on src, choose "add folder to java source path"

Sign up to request clarification or add additional context in comments.

Comments

5

You can solve this by opening your current project folder in vs code, then navigate to "Java Projects" > "properties" > "clean workspace".

2 Comments

Worked for me. There was a prompt to clean up the language server workspace. Cleanup resolved the warning.
How do you navigate to `Java Projects ?
0

Tried other solutions here but didn't work for me, what eventually worked for me was:

  1. Moving the java file to a folder. (A project folder)
  2. Make sure the project folder is opened on the explorer tab in VS codes

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
0

First click on the Java status menu and then Clean Workspace Cache and the warning should go away.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.