Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369688 - Non-Exported jars are imported
Summary: Non-Exported jars are imported
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.8 M6   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 372292 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-01-25 10:55 EST by Marvin Fröhlich CLA
Modified: 2012-03-12 07:00 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marvin Fröhlich CLA 2012-01-25 10:55:49 EST
Build Identifier: 20110916-0149

I have two projects.
Project A imports some jars j.jar and k.jar.
Nothing but project A's source is exported under "Order and Export".
Project B imports project A.
The following command executed from within B, which is run through a launch configuration:
System.err.println( System.getProperty( "java.class.path" ) );
includes j.jar and k.jar from project A.

Reproducible: Always
Comment 1 Stephan Herrmann CLA 2012-01-26 08:39:56 EST
(In reply to comment #0)
> Build Identifier: 20110916-0149
> 
> I have two projects.
> Project A imports some jars j.jar and k.jar.
> Nothing but project A's source is exported under "Order and Export".

This is in the "Java Build Path" preferences, right?
So the effect is, that the compiler will not let a project importing A refer to classes from j.jar or k.jar. These checks happen at compile time.

> Project B imports project A.
> The following command executed from within B, which is run through a launch
> configuration:
> System.err.println( System.getProperty( "java.class.path" ) );
> includes j.jar and k.jar from project A.

This, in contrast, happens at runtime. Now for classes in A to correctly be loaded and their code executed they'll likely depend on j.jar and k.jar. So without those jars on the classpath, A would be broken.

Please let me know if I misunderstood anything.
Otherwise I'd say everything works exactly as intended.
Comment 2 Marvin Fröhlich CLA 2012-01-30 05:10:07 EST
Ok, I think, you opened my eyes. Thanks. Should be alright then.
Comment 3 Jay Arthanareeswaran CLA 2012-02-27 00:22:24 EST
*** Bug 372292 has been marked as a duplicate of this bug. ***
Comment 4 Satyam Kandula CLA 2012-03-12 07:00:23 EDT
Verified for 3.8M6