Bug 46842 - .class files in the default package in a jar are ignored
Summary: .class files in the default package in a jar are ignored
Status: RESOLVED WORKSFORME
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:
Depends on:
Blocks:
 
Reported: 2003-11-18 11:01 EST by Patrick Huber CLA
Modified: 2003-11-19 05:02 EST (History)
0 users

See Also:


Attachments
The jar file in question (43.75 KB, application/octet-stream)
2003-11-18 11:04 EST, Patrick Huber CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Huber CLA 2003-11-18 11:01:15 EST
I need to include some jar file into a project. That jar contains only .class
files - some are in the default package and some are in subpackages.

In my code, classes which are in a subpackage can be found. The classes in the
default package can, so thinks eclipse, not be resolved.

I'm running the M4 build of the 3.0 eclipse (200310101454) under winxp here. On
a different system with eclipse 2.1 (200302211557) under w2k, everything works
fine, all symbols can be resolved.

The project configuration is in both eclipse version, as far as I can tell, the
same.
Comment 1 Patrick Huber CLA 2003-11-18 11:04:30 EST
Created attachment 6837 [details]
The jar file in question

In the code, the classes FlexibleConstants, FlexibleConstraints, FlexibleLayout
cannot be resolved. ptolemy.plot.Plot works fine
Comment 2 Philipe Mulet CLA 2003-11-18 11:12:52 EST
3.0 M4 is defaulting to compiler 1.4 compliant mode, whereas 2.1.1 defaults to 
1.3 compiler compliant mode. In 1.4, the default package is no longer 
accessible from the outside.

This is a language evolution.
Comment 3 Patrick Huber CLA 2003-11-18 12:10:33 EST
I'm sorry, there's one thing I forgot to mention: 
 
in both configurations, eclipse was told to use a 1.1.7 jdk (it's an applet 
and everyone should be able to run it, even with the ms-jvm). 
Comment 4 Olivier Thomann CLA 2003-11-18 13:58:39 EST
What are your compliance settings?
Go to Preferences>Java>Compiler>Compliance and Classfiles.
If this is 1.4, you need to change it to 1.3.
Comment 5 Philipe Mulet CLA 2003-11-18 18:00:50 EST
To clarify. Eclipse uses its own compiler which can be configured to either 
perform as a 1.3 or 1.4 compiler.

If you want to compile your code against a JDK1.1.7, this should work fine as 
long as you ensure the .class file compliance level is set to 1.1 (under 
Preferences>Java>Compiler>Compliance and Classfiles).

If you also want to be able to compile against classes in default package, then 
you also need to turn the compiler compliance to 1.3, since as I said in 
previous comment, the language got changed around 1.4 so as to disallow these 
type of accesses.

Is it ok to close ?
Comment 6 Patrick Huber CLA 2003-11-19 04:37:24 EST
Changing the Compiler compliance level solved the problem.

Thanks for your help
Comment 7 Philipe Mulet CLA 2003-11-19 05:00:33 EST
Should have been closed as workforme.
Comment 8 Philipe Mulet CLA 2003-11-19 05:02:56 EST
Closing