You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Package error not reported with "java.jdt.ls.javac.enabled":"on" #4414
Describe the bug
When using "java.jdt.ls.javac.enabled":"on" on a unmanaged project, if the package does not match the folder hierarchy, no error is reported in VSCode interface
Open file foo\bar\ex02.java -> The package is incorrect (bar instead of foo.bar) but no error is reported
File ex01.java has the correct package
File ex03.java has no package (compact source file)
Expected behavior
A package error should be reported for ex02.java and ex03.java . In fact, the class file are not placed in the correct folders in the workspace cache folder (see left side of the picture below). When javac is on, the class are placed in folders according to the package declared in the java file instead of the original folder hierarchy. So since the class file matches the package, no package error is reported. The correct behavior is to keep the class files in the same folders of the source java files like when javac is off (right side of picture below)
Screenshots
Environment
Operating System: Debian 13
JDK version: 25
Visual Studio Code version: 1.121
Java extension version: 1.54.0
Additional Information
Maybe it is a problem in the JDT-LS from Eclipse?
Activity