Bug 48407 - problems with source files where the package name doesn't match directory structure
Summary: problems with source files where the package name doesn't match directory str...
Status: RESOLVED DUPLICATE of bug 16209
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1.2   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-10 09:08 EST by Carl Osipov CLA
Modified: 2003-12-11 00:52 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carl Osipov CLA 2003-12-10 09:08:07 EST
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.
Comment 1 Philipe Mulet CLA 2003-12-11 00:52:36 EST

*** This bug has been marked as a duplicate of 16209 ***