Community
Participate
Working Groups
Unlike the JDK javac compiler, the eclipse compiler has odd behavior when dealing with source files that declare a package name but reside in the top level directory(as children of the project directory). For instance given a source file: package example; public class Main { public static void main(String[] args) { System.out.println("Hello World"); } } stored under as ${WORKSPACE}\test\Main.java where the test directory is a name of a Java project, the compiler generates binaries in ${WORKSPACE} \test\Main.class. In contrast the default javac compiler generates binaries that resolve to the appropriate package name: ${WORKSPACE} \test\example\Main.class An obvious workaround doesn't work correctly: trying to specify example as an output directory(Java Build Path setting in the project properties) actually copies the entire contents of the project directory to the output directory.
*** This bug has been marked as a duplicate of 16209 ***