Bug 45206 - A class in the 'default package' in one project cant be seen from a 'non-default package' class in another project
Summary: A class in the 'default package' in one project cant be seen from a 'non-defa...
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M5   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 60524 72361 77004 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-10-20 08:50 EDT by buhl CLA
Modified: 2004-10-26 13:23 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description buhl CLA 2003-10-20 08:50:58 EDT
I have the following situation in build M4 (it works fine in M3):
 
I have created two Java Projects test1 and test2. Each project has a src-folder 
for the classes and bin-folders for the class files. In test1 I have a class 
Test1.java in the 'default package' and in test2 I have a class Test2.java in 
the package 'test'. 

The project test2 has test1 on its build path. When I try to create an instance 
of Test1 from Test2's constructor it cannot resolve Test1 and I cannot import 
Test1 from Test2.

(If Test2 is also in the 'default package' it works just fine.)
Comment 1 John Arthorne CLA 2003-10-20 11:32:35 EDT
Sounds expected to me.  I don't think the default package can be exported across
projects.  Moving to JDT for further comment.
Comment 2 Olivier Thomann CLA 2003-10-20 13:33:50 EDT
I guess your compiler compliance level is 1.4. See
Preferences>Java>Compiler>Compliance and Class files.

This is normal. It is not possible anymore to import default package inside a
package using javac 1.4. This was a bug that has been fixed in 1.4.

If you set your compiler compliance level to 1.3, it will work. It is actually
much better to put your class in a package than leaving it in the default package.
Comment 3 Philipe Mulet CLA 2003-10-20 15:48:46 EDT
Indeed this is 1.4 spec'ed behavior.
Comment 4 Olivier Thomann CLA 2004-04-29 22:00:40 EDT
*** Bug 60524 has been marked as a duplicate of this bug. ***
Comment 5 Olivier Thomann CLA 2004-08-20 16:11:28 EDT
*** Bug 72361 has been marked as a duplicate of this bug. ***
Comment 6 Luc Bourlier CLA 2004-10-26 13:23:47 EDT
*** Bug 77004 has been marked as a duplicate of this bug. ***