I'm able to compile and run my code but there is always an error showing in VSCode. Earlier there was a pop up I don't remember what and I clicked "apply globally" and it's been this way since.
Output is there but so is the error

The declared package "" does not match the expected package

Thanks to the comment of @beatrice above, I found the answer here.
My .vscode\settings.json file had some paths explicitly added. I had added them manually when Visual Studio code was not misbehaving, by right-clicking on certain project folders and doing "add Folder to Java source path".
The solution for me was to basically remove all of them from .vscode\settings.json, replacing its contents with:
{
"java.project.sourcePaths": [""]
}
This finally made VsCode work again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With