-
Notifications
You must be signed in to change notification settings - Fork 344
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
ClassNotFoundException on adding and running new java file #606
Comments
Could you share your user setting |
It is enabled for both user and workspace. |
No clue about the cause. I would suggest you to try VS Code command |
Tried |
Any update? Anything else I could try? Log files: logs.zip |
The repo here you provided is just some empty folders, not sure how to reproduce this issue. |
|
What is your workspace root when you open the folder in VS Code? If you could share your current VS Code screenshot, that may help me better understand your user scenario. |
I am going to generate a gif that exhibits the problem. Will post soon. |
@testforstephen I have a gif here that exhibits the problem. |
I see, thanks. Revisit your previous logfile from #606 (comment), i found there are some error details. Looks like the builder got some problems when generating .class file into
The error |
@manastalukdar i can reproduce it in other project, this issue is duplicated with eclipse-jdtls/eclipse.jdt.ls#1137. The root cause is the Java language server doesn't refresh the new package to underlying jdt. We're fixing it in eclipse.jdt.ls side. Current workaround is reload VS Code window. |
Language Support for Java(TM) by Red Hat 0.51.0 release has fixed this issue. |
Fixed. Thanks. |
So looks like I had this issue again, but I was able to resolve it. |
try deleting the .vscode folder and run it again |
welcome ,sir, this error appears to me when I run code |
I vote here too, the problem still persists on my VS Code with the analogous message as in previous post. |
This issue happens to me too. It's like viscose doent recognize when I create a file. No package is given, if I use source action to create functions, it creates a new file with only functions, no class, no package etc. |
#692 (comment) |
On adding a new Java file into an existing project and clicking on the
Run
orDebug
text at the top ofmain
function results in ClassNotFoundException. Same issue also happens when manually adding the mainClass entry in the launch.json file.Workaround: Do a Full
Java: Force Java Compilation
from the command palette before attempting toRun
orDebug
themain
function. Or, restart/reload VSCode, which appears to trigger a force compilation.Repro repo: here
Runtime information
JDK: 12
Debugger for Java: 0.20.0
VSCode:
The text was updated successfully, but these errors were encountered: