Skip to content

[bug] workspace storage is breaking vscode-java-debug #720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
clankill3r opened this issue Nov 22, 2019 · 7 comments
Closed

[bug] workspace storage is breaking vscode-java-debug #720

clankill3r opened this issue Nov 22, 2019 · 7 comments

Comments

@clankill3r
Copy link

I reported this before, but I had issues isolating it. Now I made a small project to reproduce the problem.

The issue:
The project is working fine. When I close and open vscode then I can't run the debugger anymore.
I get:

Build failed, do you want to continue?

Source: Debugger for Java (Extension)

If I remove the workspace storage then the problem is gone.

Environment
  • Operating System: OSX 10.12.6 / Ubuntu 18.04lts
  • JDK version: 1.8.0_202
  • Visual Studio Code version: 1.40.1
  • Java extension version: ?
  • Java Debugger extension version: 0.23.0
    --Red Hat extension: 0.53.1
Steps To Reproduce

[1]
Download:
https://github.com./clankill3r/vscode-java-debug_broken_example
Have it at the root of the HD so it starts with /java!

Screen Shot 2019-11-22 at 16 06 36

[2]
Open the folder /java/projects/ws_root, when you get the message prompt about the workspace folder containing a workspace then click open workspace.

[3]
Open the file nasa/src/doeke_nasa/Nasa.java, and press F5 to run it.
The first time it should print "here" in the debug console.

[4]
Close VSCode, start VSCode again and try to run the same file again. Now you will get an:

Build failed, do you want to continue?

Source: Debugger for Java (Extension)

[5]
Close VSCode,
Remove the workspace storage,
Start VSCode again, and run again, now it should work again.

Current Result

Build failed message

Expected Result

Have everything working fine

Additional Informations
@testforstephen
Copy link
Contributor

By the design of current vscode-java extension, actually /java/projects/ws_root/.classpath is not visible to java files in the other folder nasa/src/doeke_nasa/Nasa.java, so the Nasa.java will report library missing, and unresolved type error.

We're designing a new approach to manage the library for VS Code java project. Keep a watch at issue microsoft/vscode-java-dependency#174

@clankill3r
Copy link
Author

Will that mean, once that is out that I need a new .classpath for every project, but that I can point to folders instead of individual jar files, making the life a bit more easy?

@testforstephen
Copy link
Contributor

The shared libraries would be saved in VS Code user settings, so that the VS Code workspace is able to share them.

@clankill3r
Copy link
Author

That sounds awesome!

@jdneo
Copy link
Member

jdneo commented Jan 16, 2020

Here is the update: microsoft/vscode-java-dependency#174 (comment)

@clankill3r
Copy link
Author

I wanted to point out that removing the VSCode workspace storage to get rid off all errors no longer works.

Now I have to visit all the files to get rid of the errors and make sure to not close VSCode.

2020-03-26 12 25 10

@testforstephen
Copy link
Contributor

This is a classpath issue, and now we allow you to use setting to customize the classpath for the no-buildtool project.

Go to .vscode/settings.json of your workspace folder, you can explicitly specify source roots and referenced libraries.

{
    "java.project.sourcePaths": [
        "src/main",
        "src"
    ],
    "java.project.referencedLibraries": [
        "lib/**/*.jar"
    ]
}

I'm closing it, feel free to reopen it if your issue is not resolved.

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

No branches or pull requests

3 participants