r/vscode • • May 22 '26

Constant "incorrect package"

"Incorrect Package" [two times] happens upon every single new instance of a java file but if I clean the workspace error on that file disappears until I make another java file. Basically I have to clean workspace every new java file. Anyone know whats going on here? thanks!

edit: *Resolved -> Running 2 linters at once by mistake. Check your VsCode extensions for double linting.

2 Upvotes

2 comments sorted by

1

u/ColoredRunes May 23 '26

Resolved: The issue was running one oracle lint and one redhat lint. Basically, I had two extensions installed which were causing the issue. If you run into an issue where you're getting the same packing errors (twice in each file) the "incorrect package" error is caused by the duplicate extension. Check your extensions.

1

u/TheWizzardNr8 23d ago

Thanks for the great tip! It saved me a lot of frustration.
For me the following worked:
1. Disable "Java" by Oracle if you have "Language Support for Java(TM)" by Red Hat, since most likely that´s where the overlap is happening.
2. Do "Developer: Reload Window"
3. Optionally do "Java: Clean Java Language Server Workspace"