You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VS Code shows a "Cannot find symbol" error with the red squigly for several symbols but "Go to definition" works which means the definition is available.
Environment
Operating System: Ubuntu 18.04
JDK version: 1.8.0_171
Visual Studio Code version: 1.23.1
Java extension version: 0.26.0
Steps To Reproduce
Open the attached dummy project in VS Code.
Current Result
You should see several errors related to "cannot find symbol". However, navigation or "Go to definition" works on these symbols.
Expected Result
The red squiggly lines should not appear since I think the symbols are indeed available.
Additional Informations
The VS Code settings.json file is also attached. java-symbols.zip
Indeed, for some reason LineAddress can't be resolved immediately. but as soon as IntegerVariantTypes.java is opened, the compilation errors disappear. Might be caused by LineAddress being an inner class in a file that's doesn't define the IntegerVariantTypes class. Same project opens fine in Eclipse.
Reacted by İnanç Dokurel, functionstackx and Piyawan Yosathorn
I got this similar problem after I disable and enable Maven Plugin, before that everything worked like a charm, firstly I disabled Maven plugin, and restarted, then I started to see those annoying errors, I then re-enabled maven plugin, unlucky, those errors are still there, unable to eliminate no matter what I do. But my code runs without any problem.
Activity
fbricon commentedon Jun 7, 2018
Indeed, for some reason LineAddress can't be resolved immediately. but as soon as IntegerVariantTypes.java is opened, the compilation errors disappear. Might be caused by LineAddress being an inner class in a file that's doesn't define the IntegerVariantTypes class. Same project opens fine in Eclipse.
alejandrosaucedo commentedon Nov 21, 2018
I have the same problem.
What is the solution?
neesonqk commentedon Jan 21, 2019
I got this similar problem after I disable and enable Maven Plugin, before that everything worked like a charm, firstly I disabled Maven plugin, and restarted, then I started to see those annoying errors, I then re-enabled maven plugin, unlucky, those errors are still there, unable to eliminate no matter what I do. But my code runs without any problem.
yaohaizh commentedon Jan 21, 2019
@neesonqk Those errors because of the inner classes. Could you call "Java: Force Java Compilation" to see whether your issue persists.
neesonqk commentedon Jan 21, 2019
@yaohaizh the issue still persists.
neesonqk commentedon Jan 21, 2019
My bad, my problem is that, I incidentally installed
java linterextension when I disable Maven Plugin...By uninstalling java linter I am able to eliminate those annoying errors.
DerMertEr commentedon Jul 26, 2025
I'm not sure why these solutions didn't work for me, but uninstalling the
Javaextension by Oracle Corporation solved it!ishaanabhinav commentedon Nov 12, 2025
works for me too
robstryker commentedon Oct 28, 2026
All of the solutions posted here seem to be unrelated to vscode-java, so... i'll be closing this issue.