Skip to content

Failed to resolve classpath: Main class 'Main' isn't unique in the workspace #21

Closed

Description

Open a java folder, see the screenshot below.
screen shot 2017-09-14 at 10 30 31 am

And click F5 to launch, it popup a message box saying that Failed to resolve classpath: Main class 'Main' isn't unique in the workspace, please pass in specified projectname..

Apparently it's not a normal eclipse/maven/gradle project, but just a simple java file. In such case, these java files will be linked to a fake project. It seems the main class isn't unique in the fake project. But in such case, user doesn't know how to specify project name. We need figure out how to handle such kind of case.

Activity

  1. akaroml commented on Sep 15, 2017

    @akaroml
    Member

    This is the feature to support debugging single file. Assign to Xuan Zhou (@ansyral).

  2. added this to the 0.2.0 milestone on Sep 15, 2017
  3. ansyral commented on Oct 12, 2017

    @ansyral
    Contributor

    couldn't repro it yet because currently our debugger doesn't support single file debug without configuration. I'll test it after we update our debugger with new debug protocol and support single file debug following microsoft/vscode#33791 (comment)

  4. ansyral commented on Oct 13, 2017

    @ansyral
    Contributor

    could repro for projects that has main class whose package is default

  5. deed02392 commented on Mar 22, 2018

    @deed02392

    I had this error.

    To repro: install the Java Extension Pack. Create a new maven generate archetype - select folder - choose maven-archetype-quickstart.

    Provide groupid etc in the PowerShell console.

    It generates the package and class App.

    Try to debug (Launch) the App class - not unique error.

    I worked around this by renaming App file and class (obviously) to Applol.

  6. andxu commented on Mar 23, 2018

    @andxu
    Contributor

    The bug for 'Main' isn't unique in the workspace still happens, reopen it

  7. andxu commented on Jun 19, 2018

    @andxu
    Contributor

    I will collect this kind of error in telemetry later.

  8. andxu commented on Aug 31, 2018

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions