Skip to content

"Cannot find symbol" #551

Description

@swarnendubiswas

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
  1. 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

Activity

  1. fbricon commented on Jun 7, 2018

    @fbricon
    Collaborator

    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.

  2. alejandrosaucedo commented on Nov 21, 2018

    @alejandrosaucedo

    I have the same problem.

    What is the solution?

  3. neesonqk commented on Jan 21, 2019

    @neesonqk

    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.

  4. yaohaizh commented on Jan 21, 2019

    @yaohaizh
    Collaborator

    @neesonqk Those errors because of the inner classes. Could you call "Java: Force Java Compilation" to see whether your issue persists.

  5. neesonqk commented on Jan 21, 2019

    @neesonqk

    @yaohaizh the issue still persists.

    image

    image

  6. neesonqk commented on Jan 21, 2019

    @neesonqk

    My bad, my problem is that, I incidentally installed java linter extension when I disable Maven Plugin...

    By uninstalling java linter I am able to eliminate those annoying errors.

  7. DerMertEr commented on Jul 26, 2025

    @DerMertEr

    I'm not sure why these solutions didn't work for me, but uninstalling the Java extension by Oracle Corporation solved it!

  8. ishaanabhinav commented on Nov 12, 2025

    @ishaanabhinav

    I'm not sure why these solutions didn't work for me, but uninstalling the Java extension by Oracle Corporation solved it!

    works for me too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions