Skip to content
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

Java compile error , with correct package name. #1958

Closed
arshappleid opened this issue May 26, 2021 · 5 comments
Closed

Java compile error , with correct package name. #1958

arshappleid opened this issue May 26, 2021 · 5 comments
Assignees

Comments

@arshappleid
Copy link

I want to use the the Java debugger, with the code-runner extension from vs code extensions, which uses a different way to come up with package path , for java. When I use that extension, by setting up a class path, and at the same time try to debug the file, the debugger gives me a compile error , stating that the package name is wrong. I can debug the code, normally if I remove the package name, but then will have to add it each time, I want to run the file, by using code-runner.

Is there a way to fix this.

to recreate the problem:

  1. Download code runner for vs code.(https://github.com/YaduAhuja/vscode-code-runner/blob/main/code-runner-0.11.4.vsix )latest version.
  2. Set the clasp path file , using the code runner keyboard settings or command pallete.
  3. run a java program.
  4. try to debug a java program.
@testforstephen
Copy link
Collaborator

Java debugger already provides the feature to run and debug a Java application. Is there any reason you have to use code runner together to debug an application?

@arshappleid
Copy link
Author

Code runner gives me the option to run multiple languages in the same terminal , and use cmd+r to run any application. Its just convenient, when you are working with multiple languages. It would be nice if I could use the debug , and the code runner at the same time.

@testforstephen
Copy link
Collaborator

Then you should set the correct classpath for Java debugger as well. You can do that within your workspace settings.json. e.g. "java.project.sourcePaths": ["src"]

@arshappleid
Copy link
Author

arshappleid commented Jun 2, 2021

Would that mean that I will not have to declare the package , before debugging the file ?

Also can I use regex for this ? such as ${filepath}.

Thanks that helped.

Also do you think it would be possible to request a feature that hides the file paths in the console to have a cleaner output ?

@testforstephen
Copy link
Collaborator

Also can I use regex for this ? such as ${filepath}.

This setting accepts relative path, doesn't support variable path.

Also do you think it would be possible to request a feature that hides the file paths in the console to have a cleaner output ?

This is a request to VS Code. microsoft/vscode#100522

Looks like you have solved the problem, i will close the issue.

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

2 participants