Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Export Jar file does not show included jar files
Export Jar file does not show included jar files [message #14469] Mon, 05 May 2003 18:24 Go to next message
Eclipse UserFriend
Originally posted by: stevenw.us.ibm.com

Running eclipse 2.1. I have a Java project and have added several jar
files in the Java Build path and checked them for export. When I export
a jar file for the project the jar files in the build path are not shown
for selection. I have also imported the jar files into the project
itself, but it still does not show the jar files. This senerio worked
under eclipse 2.0. Is there something I need to do or missing? Is this a
known problem?
regards, steve
Re: Export Jar file does not show included jar files [message #14680 is a reply to message #14469] Tue, 06 May 2003 04:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

Steve wrote:

>Running eclipse 2.1. I have a Java project and have added several jar
>files in the Java Build path and checked them for export. When I export
>a jar file for the project the jar files in the build path are not shown
>for selection. I have also imported the jar files into the project
>itself, but it still does not show the jar files. This senerio worked
>under eclipse 2.0.
>
Not to sure to what you refer but plain Eclipse JAR File export never
supported to select/export JAR files which are on the Java build path.
To get this to work you could
- add the JAR as external JAR and at the same time put the JAR into the
root of your project (but don't add this one the the Java build path)
- put the JAR into the root of your project (but don't add this one the
the Java build path) and into a sub-folder (e.g. libs) and then add the
JAR from sub-folder to the Java build path. You will then be able to
export the JAR in the project's root.

HTH
Dani
Re: Export Jar file does not show included jar files [message #14932 is a reply to message #14680] Tue, 06 May 2003 07:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: stevenw.us.ibm.com

Dani, thanks a bunch, that was the piece iIwas missing. I had the jar files
defined both in my buid path and also imported them into my project/lib. Once
I corrected the build to point to the jar files in their original location my
export jar of the project then exposed the jar in my lib dir. That is what I
had done in 2.0, but seemed to forget about that point when migrating to 2.0.
Thanks again for the timely reply, Steve

Daniel Megert wrote:

> Steve wrote:
>
> >Running eclipse 2.1. I have a Java project and have added several jar
> >files in the Java Build path and checked them for export. When I export
> >a jar file for the project the jar files in the build path are not shown
> >for selection. I have also imported the jar files into the project
> >itself, but it still does not show the jar files. This senerio worked
> >under eclipse 2.0.
> >
> Not to sure to what you refer but plain Eclipse JAR File export never
> supported to select/export JAR files which are on the Java build path.
> To get this to work you could
> - add the JAR as external JAR and at the same time put the JAR into the
> root of your project (but don't add this one the the Java build path)
> - put the JAR into the root of your project (but don't add this one the
> the Java build path) and into a sub-folder (e.g. libs) and then add the
> JAR from sub-folder to the Java build path. You will then be able to
> export the JAR in the project's root.
>
> HTH
> Dani
Re: Export Jar file does not show included jar files [message #27105 is a reply to message #14680] Sat, 17 May 2003 08:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: chris.junctionbox.com

Hi Daniel, I am trying to do this too, but I'm new to Eclipse.

Could you be more specific on how to do this? If in the properties of my
project I add an external
JAR, it gets added to the root of the project, and to the build path.
Secondly the only way I can
get a JAR at the root of the project is by importing it as a file, in
which case it then gets its
containing directory in the root of the project.

I've tried all sorts of combinations and I still get a missing class when
running the resulting JAR.

Thanks,

Chris.


Daniel Megert wrote:

> Steve wrote:

> >Running eclipse 2.1. I have a Java project and have added several jar
> >files in the Java Build path and checked them for export. When I export
> >a jar file for the project the jar files in the build path are not shown
> >for selection. I have also imported the jar files into the project
> >itself, but it still does not show the jar files. This senerio worked
> >under eclipse 2.0.
> >
> Not to sure to what you refer but plain Eclipse JAR File export never
> supported to select/export JAR files which are on the Java build path.
> To get this to work you could
> - add the JAR as external JAR and at the same time put the JAR into the
> root of your project (but don't add this one the the Java build path)
> - put the JAR into the root of your project (but don't add this one the
> the Java build path) and into a sub-folder (e.g. libs) and then add the
> JAR from sub-folder to the Java build path. You will then be able to
> export the JAR in the project's root.

> HTH
> Dani
Re: Export Jar file does not show included jar files [message #28200 is a reply to message #27105] Mon, 19 May 2003 03:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

Chris Aves wrote:

>Hi Daniel, I am trying to do this too, but I'm new to Eclipse.
>
>Could you be more specific on how to do this? If in the properties of my
>project I add an external
>JAR, it gets added to the root of the project, and to the build path.
>
Sure that's the result of your action (adding it to the root ;-). You
have to create a directory (e.g. lib) put the JAR into that directory
and then put "lib/my.jar" to the Java build path.

>Secondly the only way I can
>get a JAR at the root of the project is by importing it as a file, in
>which case it then gets its
>containing directory in the root of the project.
>
Correct. You import the JAR as file. You will then see it e.g. as my.jar
but you will not be able to drill into it since it is not on the Java
build path.

HTH
Dani
Re: Export Jar file does not show included jar files [message #35612 is a reply to message #28200] Thu, 22 May 2003 14:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: chris.junctionbox.com

Hi Daniel,

Sorry, but I'm still confused, and I've spent another hour trying to
resolve this. Could you outline
step by step what I have to do from the start right
through to export? Suppose I have a jar file my.jar which is in a
directory outside of my project.

Thanks,

Chris.

Daniel Megert wrote:

> Chris Aves wrote:

> >Hi Daniel, I am trying to do this too, but I'm new to Eclipse.
> >
> >Could you be more specific on how to do this? If in the properties of my
> >project I add an external
> >JAR, it gets added to the root of the project, and to the build path.
> >
> Sure that's the result of your action (adding it to the root ;-). You
> have to create a directory (e.g. lib) put the JAR into that directory
> and then put "lib/my.jar" to the Java build path.

> >Secondly the only way I can
> >get a JAR at the root of the project is by importing it as a file, in
> >which case it then gets its
> >containing directory in the root of the project.
> >
> Correct. You import the JAR as file. You will then see it e.g. as my.jar
> but you will not be able to drill into it since it is not on the Java
> build path.

> HTH
> Dani
Re: Export Jar file does not show included jar files [message #36808 is a reply to message #35612] Fri, 23 May 2003 09:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

Chris Aves wrote:

>Hi Daniel,
>
>Sorry, but I'm still confused, and I've spent another hour trying to
>resolve this. Could you outline
>step by step what I have to do from the start right
>through to export? Suppose I have a jar file my.jar which is in a
>directory outside of my project.
>
1. Open the properties of your Java project (it has to be a Java project)
2. Click on "Java Build Path"
3. Click on "Libraries" tab
4. Click "Add External JARs..."
5. Select your my.jar and click "OK"
6. Click "OK" on the properties page
==> The JAR is now on the build path
7. Select your Java project
8. Select "Import..." from the context menu
9. Select "File system" and click "Next >"
10. Click the upper "Browse..." button
11. Select the folder in which my.jar resides
12. Select my.jar on the right side
13. Ensure that "Create selected folders only" is checked
14. Click "Finish"
==> The JAR is now in your project (top-level)

If you now export your project to a JAR you will be able to select the
JAR. However, the use of this is quite limited because normal class
loaders will not find classes in a JAR that resides in a JAR. I suggest
to think about this again to be sure that this is really what you want.

Dani
Re: Export Jar file does not show included jar files [message #37852 is a reply to message #36808] Sat, 24 May 2003 04:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: chris.junctionbox.com

Hi Daniel,

Thanks for this. This was what I was doing, but your last comment was
useful - something I
didn\\\'t know. I guess the best way to package up my application is to
use another JAR packager.

Chris.

Daniel Megert wrote:

> Chris Aves wrote:

> >Hi Daniel,
> >
> >Sorry, but I\\\'m still confused, and I\\\'ve spent another hour trying to
> >resolve this. Could you outline
> >step by step what I have to do from the start right
> >through to export? Suppose I have a jar file my.jar which is in a
> >directory outside of my project.
> >
> 1. Open the properties of your Java project (it has to be a Java project)
> 2. Click on \\\"Java Build Path\\\"
> 3. Click on \\\"Libraries\\\" tab
> 4. Click \\\"Add External JARs...\\\"
> 5. Select your my.jar and click \\\"OK\\\"
> 6. Click \\\"OK\\\" on the properties page
> ==> The JAR is now on the build path
> 7. Select your Java project
> 8. Select \\\"Import...\\\" from the context menu
> 9. Select \\\"File system\\\" and click \\\"Next >\\\"
> 10. Click the upper \\\"Browse...\\\" button
> 11. Select the folder in which my.jar resides
> 12. Select my.jar on the right side
> 13. Ensure that \\\"Create selected folders only\\\" is checked
> 14. Click \\\"Finish\\\"
> ==> The JAR is now in your project (top-level)

> If you now export your project to a JAR you will be able to select the
> JAR. However, the use of this is quite limited because normal class
> loaders will not find classes in a JAR that resides in a JAR. I suggest
> to think about this again to be sure that this is really what you want.

> Dani
My solution [message #38276 is a reply to message #36808] Sun, 25 May 2003 04:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: chris.junctionbox.com

Further to what I wrote above, rather than write a specific class loader
for my application which
finds the .jar in question, I unjar'd the .jar into my project directory,
then jar'd up the application
myself.

It would be useful to be able to do this in Eclipse with the Import
function. You can import .jar
files by importing them as .zip's (which causes the jar contents to be
extracted and populated in
the project). But, currently, in Eclipse 2.1, importing only imports the
resources, i.e. gif's etc. and
not .class files.

Chris.

Daniel Megert wrote:

> Chris Aves wrote:

> >Hi Daniel,
> >
> >Sorry, but I'm still confused, and I've spent another hour trying to
> >resolve this. Could you outline
> >step by step what I have to do from the start right
> >through to export? Suppose I have a jar file my.jar which is in a
> >directory outside of my project.
> >
> 1. Open the properties of your Java project (it has to be a Java project)
> 2. Click on "Java Build Path"
> 3. Click on "Libraries" tab
> 4. Click "Add External JARs..."
> 5. Select your my.jar and click "OK"
> 6. Click "OK" on the properties page
> ==> The JAR is now on the build path
> 7. Select your Java project
> 8. Select "Import..." from the context menu
> 9. Select "File system" and click "Next >"
> 10. Click the upper "Browse..." button
> 11. Select the folder in which my.jar resides
> 12. Select my.jar on the right side
> 13. Ensure that "Create selected folders only" is checked
> 14. Click "Finish"
> ==> The JAR is now in your project (top-level)

> If you now export your project to a JAR you will be able to select the
> JAR. However, the use of this is quite limited because normal class
> loaders will not find classes in a JAR that resides in a JAR. I suggest
> to think about this again to be sure that this is really what you want.

> Dani
Re: My solution [message #39049 is a reply to message #38276] Mon, 26 May 2003 04:43 Go to previous message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

Chris Aves wrote:

>Further to what I wrote above, rather than write a specific class loader
>for my application which
>finds the .jar in question, I unjar'd the .jar into my project directory,
>then jar'd up the application
>myself.
>
Why this? Why don't you simply put your code plus the JAR on to the Java
build path? If you need to distribute the code you should first JAR your
plain code and then use ZIP (i.e. File > Export > Zip File) to bundle
the existing JAR plus the JAR with your code. Putting two JARs into one
JAR is not a good idea because it lacks the hint that the archive needs
to be unpacked before running.

>It would be useful to be able to do this in Eclipse with the Import
>function. You can import .jar
>files by importing them as .zip's (which causes the jar contents to be
>extracted and populated in
>the project). But, currently, in Eclipse 2.1, importing only imports the
>resources, i.e. gif's etc. and
>not .class files.
>
Of course it does. The standard import has no knowledge of Java. If your
archive contains .class files and you select them for import then they
will be imported. Maybe they are hidden due to some filter or because
you are in the Package Explorer.

Dani
Previous Topic:fundamental flaw in type hierarchies?
Next Topic:StyledText of JavaEditor
Goto Forum:
  


Current Time: Tue Jul 15 08:34:05 EDT 2025

Powered by FUDForum. Page generated in 0.34780 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top