Skip to content

Visual Studio Code deleting class files in target folder #2909

Open
@kirantez

Description

@kirantez

I'm working on multi module Maven project, i built in cmd using mvn clean install/deploy and the build is successful, all the class files in target\class folder are generated.

But when i import this project in VS Code, while opening the projects it is deleting all the class files i.e it deletes target\classes*com* folder in all the projects.

And, VS code doesn't resolve the dependencies in java files until the file is opened.

How do I fix this?

So, when the all the class files are deleted, it is unable to debug the code. While I try to run the code, it shows following error:

Error: Could not find or load main class com.application.Main Caused by: java.lang.ClassNotFoundException: com.application.Main

Environment
  • Operating System: Windows 10
  • JDK version: 11+
  • Visual Studio Code version: 1.74.3

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