Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: cannot create the runnable JAR file containing 3rd party JAR files Date: Wed, 21 Dec 2011 14:23:48 -0800 Organization: A noiseless patient Spider Lines: 56 Message-ID: References: <12e4a109-e7da-410e-b16c-330884bf35d2@o14g2000vbo.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 21 Dec 2011 22:23:50 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="XjIWM99mD7Ijfdu600oVPA"; logging-data="27115"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+PNnQiBhxyPuFOx9nDZp/TuZy5J9gDJh4=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: <12e4a109-e7da-410e-b16c-330884bf35d2@o14g2000vbo.googlegroups.com> Cancel-Lock: sha1:VAg3oyYTVEZuuEhiyBXvTwI6fNM= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:10938 On 12/21/2011 12:03 PM, www wrote: > I have had a really hard time to create a runnable JAR file using > Ant(version 1.6.5). The JAR file, libs/installed/sample.jar, can be > generated. However, when I run it, the classes inside a.jar or b.jar > are not available and causes NullPointerException. When I un-tar > sample.jar, everything is there. I think manifest classpath is causing > the problem. > Could you show us the actual error message? It would help. Also when the error occurs, if there aren't too many lines in between the launch and the error message. Also please show us the Java command line itself and the contents of the Jar and manifest file. Like this: Brenden@Kageyama ~/Dev/proj/hw/dist $ java -jar hw.jar Hello world! <<-- you would have an error message here instead Brenden@Kageyama ~/Dev/proj/hw/dist $ jar -tf hw.jar META-INF/ META-INF/MANIFEST.MF hw/ hw/Hw.class Brenden@Kageyama ~/Dev/proj/hw/dist $ jar -xf hw.jar META-INF/MANIFEST.MF Brenden@Kageyama ~/Dev/proj/hw/dist $ ls META-INF README.TXT hw.jar Brenden@Kageyama ~/Dev/proj/hw/dist $ cat META-INF/MANIFEST.MF Manifest-Version: 1.0 Ant-Version: Apache Ant 1.8.2 Created-By: 1.7.0-b147 (Oracle Corporation) Class-Path: X-COMMENT: Main-Class will be added automatically by build Main-Class: hw.Hw > > > > > Neat, I learned something new.