Thanks DD for your prompt reply,

I am trying to set classpath for a standalone application and I am not able
to figure out what exactly I am doing wrong. Below is the classpath that is
being generated in the MANIFEST.MF And this isn't valid classpath , when I
run java -jar mystandaloneapplication.jar, it cannot find any classes.

Class-Path: aaa.jar bbb.jar ccc.jar ddd.jar eee.jar fff.jar ggg.jar hh
 h.jar iii.jar jjj.jar kkk.jar lll.jar mmm.jar nnn.jar ooo.jar ppp.jar
  qqq.jar rrr.jar sss.jar ttt.jar uuu.jar vvv.jar www.jar xxx.jar yyy.
 jar zzz.jar


*Code Snippet:*
 jar.classpath.id = aaa.jar bbb.jar ccc.jar ddd.jar eee.jar fff.jar ggg.jar
hhh.jar iii.jar jjj.jar kkk.jar lll.jar mmm.jar nnn.jar ooo.jar ppp.jar
qqq.jar rrr.jar sss.jar ttt.jar uuu.jar vvv.jar www.jar xxx.jar yyy.jar
zzz.jar
 <manifestclasspath property="jar.manifest.attribute.class-path"
       jarfile="${dir.build.packages}/${file.name}.jar" maxparentlevels="0">
       <classpath refid="jar.classpath.id" />
 </manifestclasspath>

 <jar manifest="${jar.package.manifest}"
               destfile="${dir.build.packages}/${file.name.jar}"
               basedir="${dir.build.jar}">
              <manifest>
                 <attribute name="Class-Path"
value="${jar.manifest.attribute.class-path}"/>
              </manifest>
 </jar>


How do I ensure that the class-path that is generated is valid and can be
loaded when I run java -jar command?

Is it possible that this can be a bug with long classpath's? I will really
really appreciate some help on this.

Regards,
Garima
On Mon, Jun 22, 2009 at 12:47 PM, Dominique Devienne <ddevie...@gmail.com>wrote:

> On Mon, Jun 22, 2009 at 11:58 AM, Garima Bathla<garima.bat...@gmail.com>
> wrote:
> > That exactly is what  I am doing, using Ant's Manifest class. Problem
> > happens to be that my classpath is too big and Manifest file has limit of
> 72
> > characters per line, so even though it spits out my configured classpath
> ,
> > it ain't set correctly (as I have listed in the orginial thread).
> >
> > Any help is highly appreciated, it must not be this tricky to set long
> > classpaths programmatically?
>
> Manifest can break a CP longer than 72 char on several lines correctly,
> using the proper rules, and has been doing it correctly for years.
>
> Very few bugs reported against it turned out to be real bugs in fact.
> So I strongly suggest you take a second look, assuming it does the
> correct thing. Note though that line breaks is only the beginning.
>
> The Class-Path: attribute also needs to use the proper file and path
> separators,
> be absolute or relative to the jar, and for this you should depend on
> ManifestClasspath,
> another Ant class that can take a Path and again format it correctly. --DD
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
> For additional commands, e-mail: dev-h...@ant.apache.org
>
>

Reply via email to