Compiler Warning J5021

Package 'identifier' should not be defined in directory 'identifier'

The compiler detected a package statement in your source file but the directory name where the source file resides does not match the package statement. Although the source code will compile, other source files will not be able to reference classes, interfaces, and delegates defined in this source file using the package name.

The following example illustrates this warning:

//source file resides in c:\files\simple
package boxes; //warning: package 'boxes' does not match directory name
'simple'
public class NotSimple{
  //warning: this class is not accessible using the current package name
}