Bug 329617 - [jar exporter] Create runnable Jar does not work correctly
Summary: [jar exporter] Create runnable Jar does not work correctly
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2010-11-06 14:20 EDT by Missing name Mising name CLA
Modified: 2010-11-26 04:57 EST (History)
3 users (show)

See Also:


Attachments
Project properties screen shots (156.91 KB, application/pdf)
2010-11-10 10:33 EST, Missing name Mising name CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Missing name Mising name CLA 2010-11-06 14:20:01 EDT
Build Identifier: 20100917-0705

When using Export to create a runnable Jar it adds everything that has been excluded in the source path.

It also does not add libraries/jars that are in the build classpath.

Reproducible: Always

Steps to Reproduce:
1. Export
2. Runnable Jar File
3. Launch configuration
5. Export destination
6. Library handling
Comment 1 Remy Suen CLA 2010-11-06 14:28:34 EDT
Issues and concerns with Eclipse's Java tooling goes to JDT.
Comment 3 Missing name Mising name CLA 2010-11-09 07:20:57 EST
(In reply to comment #2)
> http://www.eclipse.org/eclipse/platform-text/development/bug-incomplete.htm.

Our source directory tree is as follows;

c:\development\source

Under source there are several directories for C++ and Java.

The Java directory is c:\development\source\com with various sub-directories for packages.

In the Project settings I have had to set the source directory to be c:\development\source and excluded all sub-directories except 'com' where the Java code is.

I have added additional third party jars to the project and have successfully built the project using Eclipse. The application also runs fine.

I now want to 'Export' (package) the application with all the third party jars into a single Runnable Jar file.

I run the Export tool and it exports every file from c:\development\source and seems to be ignoring my Project properties for the java source.

I therefore getting all our C++, Java, Java Classes added into the Jar file, which I am not expecting.

I expect the application classes and third party jar files as the single Runnable Jar File.
Comment 4 Missing name Mising name CLA 2010-11-09 07:22:16 EST
I have re-opened the issue see my previous comment.
Comment 5 Dani Megert CLA 2010-11-10 08:56:38 EST
OK, so the generated JAR does work but it has too many files?
Comment 6 Missing name Mising name CLA 2010-11-10 09:00:12 EST
No it does not work, it contains all the files from the root directory and sub-directories.

Which means it has as well as the Java source and classes, my C++ source files and header files.
Comment 7 Dani Megert CLA 2010-11-10 09:26:10 EST
With "work" I mean, the JAR can be used to run your app using java -jar. Is that not the case?
Comment 8 Dani Megert CLA 2010-11-10 09:31:46 EST
>In the Project settings I have had to set the source directory to be
>c:\development\source and excluded all sub-directories except 'com' where the
>Java code is.
How exactly do you exclude them? Are you using resource filters or do you exclude them from the Java build path?

So far I cannot reproduce this. Please add detailed steps that allow us to reproduce the problem, otherwise we can't do much.
Comment 9 Missing name Mising name CLA 2010-11-10 10:33:24 EST
Created attachment 182819 [details]
Project properties screen shots

I have attached screen shots of my project properties.
Comment 10 Dani Megert CLA 2010-11-10 10:56:59 EST
(In reply to comment #9)
> Created an attachment (id=182819) [details] [diff]
> Project properties screen shots
> 
> I have attached screen shots of my project properties.
Unfortunately I can't see from that screenshot how your project is set up (e.g. does it use linked resources, resource filters, etc.). As said, best is to provide steps or attach a little demo project which is setup your way.
Comment 11 Dani Megert CLA 2010-11-12 05:58:12 EST
Ping.
Comment 12 Dani Megert CLA 2010-11-26 04:57:29 EST
.