Skip to content

VSCode Java doesn't handle .classpath files properly #606

Closed

Description

@robertmaxton42
Environment
  • Operating System: Windows
  • JDK version: 1.8.0_171
  • Visual Studio Code version: 1.25.1
  • Java extension version: 0.29.0
Steps To Reproduce
  1. Copy, write, or otherwise create an Eclipse-style .classpath file, specifying a src directory.
  2. Create an empty foo.java file in that directory
Current Result

Popup: foo.java isn't on the classpath.

Expected Result

No popup, working go-to-definition and similar project handling.

Additional Information

It is not entirely clear from the website that 'More information' leads to what precisely needs to be copied for the vscode-java to properly build the classpath, so if the answer turns out to be "you need more than just the .classpath", the issue just changes to "the documentation on 'Classpath is incomplete' does not provide sufficient information to actually resolve the issue."

(Also, note that the error is different from that one given when there is no classpath present. vscode-java clearly sees that there's a file there, but isn't reading it correctly.)

bugrepro.zip

Activity

  1. yaohaizh commented on Aug 7, 2018

    @yaohaizh
    Collaborator

    @robertmaxton42 I cannot repro this issue. I directly open the extract folder using VSCode and it is recognized as a normal java project with features supports.

    How open the test file and .classpath? Do you first open VSCode and then copied files to the workspace?

  2. robstryker commented on Oct 28, 2026

    @robstryker
    Contributor

    Cannot replicate.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions