Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #19579
| Newsgroups | comp.lang.java.programmer |
|---|---|
| Date | 2012-10-31 12:41 -0700 |
| References | <c34600e7-78d9-44a5-a79c-ee804ed992e2@googlegroups.com> <886c48ec-4c59-4a04-bab3-7e30dccb2edf@googlegroups.com> |
| Message-ID | <c990d5fb-ce12-46e3-8877-056eca35066f@googlegroups.com> (permalink) |
| Subject | Re: a question about creating the JAR file |
| From | zyng <xsli2@yahoo.com> |
Thank you for the reply. All you said makes sense and I am following you and I agree with your recommendation of zipping hello.jar, helper.jar etc and the two ways of organizing the files.
However, I still have part of my question unanswered: I have two Eclipse projects(HELPER and HELLO). The project HELLO depends on the project HELPER. Now, I want to create an executable JAR file for HELLO project, in build.xml of HELLO project:
<path id="project.classpath">
<pathelement location="${build.dir}" />
<fileset dir="${helper.lib.dir}">
<include name="helper.jar"/>
</fileset>
</path>
Of course, I built helper.jar using Ant beforehand. So now, compiling HELLO code using Ant goes through. As said previously, the code of HELLO project uses the code in HELPER project. The target of "jar" is bundling everything in build directory.
(Pardon me for sticking to my big fat JAR approach). If I don't expand helper.jar into build directory before running "jar" target, running hello.jar will have java.lang.NoClassDefFoundError: aaa/bbb/ccc/AClassInHelper
To make it work, I need expanding helper.jar into build/ beforehand. I thought during compiling the HELLO project, aaa/bbb/ccc/AClassInHelper from helper.jar has been extracted into the binary code xxx/yyy/zzz/AClassInHelloUsingHelperClass.class
Thank you.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
a question about creating the JAR file zyng <xsli2@yahoo.com> - 2012-10-26 13:58 -0700
Re: a question about creating the JAR file Lew <lewbloch@gmail.com> - 2012-10-26 14:14 -0700
Re: a question about creating the JAR file zyng <xsli2@yahoo.com> - 2012-10-31 12:41 -0700
Re: a question about creating the JAR file Lew <lewbloch@gmail.com> - 2012-10-31 15:19 -0700
Re: a question about creating the JAR file Sven Köhler <remove-sven.koehler@gmail.com> - 2012-10-27 16:54 +0200
Re: a question about creating the JAR file Jan Burse <janburse@fastmail.fm> - 2012-10-27 17:20 +0200
Re: a question about creating the JAR file Jan Burse <janburse@fastmail.fm> - 2012-10-27 17:24 +0200
Re: a question about creating the JAR file Sven Köhler <remove-sven.koehler@gmail.com> - 2012-10-27 19:06 +0200
Re: a question about creating the JAR file Lew <lewbloch@gmail.com> - 2012-10-28 09:44 -0700
Re: a question about creating the JAR file Roedy Green <see_website@mindprod.com.invalid> - 2012-11-01 18:26 -0700
csiph-web