Bug 118223

Summary: [jar exporter] 'select depended classes' button
Product: [Eclipse Project] JDT Reporter: Rodion Dokhtorenko <rod>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: brian.lajevardi, sdb, simonlee
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Rodion Dokhtorenko CLA 2005-11-28 08:02:21 EST
Hello JDT Team,

please, consider acceptance of the following feature request: we have Java Project  MyMainProject and another Java Project AnotherProject, on some classes of which MyMainProject depends on. (for ex., it's a client-server system with the common communication protocol and/or serializable java-classes). In Eclipse we can easily handle of the such kind dependencies (by Project Properties->Java Build Path->Projects) and Eclipse will build MyMainProject without problems.
But when I EXPORTING MyMainProject as JAR then resulting *.jar is not usable because doesn't contain "external" for this project classes from AnotherProject. Is it possible to add in Export Wizard additional option "Put all required classes into this JAR"? It will be nice and really useful, because Export as JAR time to time means some kind of deploying.

Thanks a lot!
Comment 1 Sam Barnett-Cormack CLA 2005-12-04 09:12:36 EST
Given that, without this, it seems impossible to actually package a stand-alone JAR (as required for a Pure Java application), I would say it was more than an enhancement... the lack of it really does seem to be a bug, IMO.
Comment 2 Olivier Thomann CLA 2005-12-04 10:37:10 EST
Move to JDT/UI
Comment 3 Martin Aeschlimann CLA 2005-12-04 12:30:37 EST
The JAR exporter just exports the files you selected. You can select files in any number of projects you want. 
I see that the 'add dependend' is a nice feature that can save you some clicking, but in general it can't help you looking at it closely to make sure you also have all resources in and classes reached through reflection.

To avoid too many clicks, I recommend you to use a JAR-description file so you can easly rerun an export. Or use ANT to create a JAR.
Comment 4 Sam Barnett-Cormack CLA 2005-12-04 13:26:38 EST
(In reply to comment #3)
> The JAR exporter just exports the files you selected. You can select files in
> any number of projects you want. 
> I see that the 'add dependend' is a nice feature that can save you some
> clicking, but in general it can't help you looking at it closely to make sure
> you also have all resources in and classes reached through reflection.
> 
> To avoid too many clicks, I recommend you to use a JAR-description file so you
> can easly rerun an export. Or use ANT to create a JAR.

I think, perhaps, that I didn't make clear what I meant - I was referring to a more general situation than the original poster, although I realise I didn't make that clear at all :)

Say I want to package up an application that uses SWT (a standalone one), or I want to include my junit test suite in a jar. It's either impossible to actually bundle these into the jar through the eclipse UI, or the way to do so is uninituitive and badly documented... if anyone can point out how one might do this, I'd be very grateful. I know that manually mucking about with an ant file would do the job, but that defeats the object of having a jar exporter in the IDE...

Comment 5 Martin Aeschlimann CLA 2005-12-06 17:24:56 EST
So you want the JAR exporter to even extract class files out of other JAR's like SWT? 
Comment 6 Sam Barnett-Cormack CLA 2005-12-07 04:03:15 EST
(In reply to comment #5)
> So you want the JAR exporter to even extract class files out of other JAR's
> like SWT? 

Or at least include the whole JAR, thus creating a complete self-contained JAR, in line with portability conventions and pure java rules (at least, as reported by O'Reilly, and I tend to trust them).

Essentially, a portable/pure java application should not rely on the system it is to be installed on having any classes available except core platform and standard extension classes. So it would be nice to be able to JAR up such an application.

Comment 7 Martin Aeschlimann CLA 2006-01-04 10:07:00 EST
*** Bug 122466 has been marked as a duplicate of this bug. ***
Comment 8 Markus Keller CLA 2006-03-24 04:57:07 EST
See also bug 83258.
Comment 9 Markus Keller CLA 2006-03-24 04:57:18 EST
*** Bug 133055 has been marked as a duplicate of this bug. ***
Comment 10 Martin Aeschlimann CLA 2006-03-28 07:58:45 EST
*** Bug 133051 has been marked as a duplicate of this bug. ***