ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ulf Karlsson" <ulf.karls...@oreline.net>
Subject Re: Ant Jar + Manifest
Date Thu, 17 Feb 2005 21:27:44 GMT
Hello,

There are diffrent classes specified:
In manifest creation: ie.comp.main.AntTool
In actual manifest: ie.dit.comp.anttool.AntToolMain
In the filesystem: ie\dit\comp\anttool\AntToolMain
In run target: ie.dit.comp.AntTool.main.AntTool

Since the run target works, the actual manifest should probably point to the 
class: ie.dit.comp.AntTool.main.AntTool
And the jar structure must of course match this class definition

Hope this helps
// Nighthawq


----- Original Message ----- 
From: "Longie" <longie@esatclear.ie>
To: "'Ant Users List'" <user@ant.apache.org>
Sent: Tuesday, February 15, 2005 2:46 PM
Subject: Ant Jar + Manifest


> Hello,
>
> I need help on this - the program runs fine from a normal dos prompt by
> calling 'run'.
>
> However if the program is run as a standalone jar file i get the error
> "Could not find the main class".
>
> I am trying to run the jar file as a standalone jar file so i need to get
> this working!
>
> Can anydody see what the problem is as i get the main-class cant be found 
> as
> i think i have hte correct manifest set!
>
> Directory Layout is as follows, all the classpaths seem ok as when i copy
> the links into a windows explorer the path directory apppears;
>
> root
> |
> |---images
> |---lib\ProjectName.jar
> |
> |---ie\dit\comp\anttool\AntToolMain.class
> |
> |---files--\ant\ant.jar
> |
> |--\xerces\xerces.jar
> -dit---comp-anttool
>
>
>
> Here is part of the build.xml file;
>
> <target name="jar" description="JARs the Task" depends="compile">
>
> <jar destfile="lib/${ant.project.name}.jar" basedir="${classes.dir}">
>
> <fileset dir="." includes="${images.dir}/**"/>
> <fileset dir="." includes="files/**"/>
>
> <manifest>
> <attribute name="Built-By" value="${user.name}"/>
> <section name="common">
> <attribute name="Specification-Title" value="AntTool"/>
> <attribute name="Specification-Version" value="Version 1"/>
> <attribute name="Specification-Vendor" value=""/>
> <attribute name="Implementation-Title" value="common"/>
> <attribute name="Implementation-Version" value="${timestamp.isoformat}"/>
> <attribute name="Implementation-Vendor" value="DIT"/>
> </section>
>
> <attribute name="Main-Class" value="ie.comp.main.AntTool"/>
> <attribute name="Class-Path" value="${lib.dir}\${ant.project.name}.jar
> ${files.dir}\ant\ant.jar ${files.dir}\xerces\xercesImpl.jar
> ${files.dir}\xerces\xml-apis.jar"/>
>
> <section name="AntTool">
>
> <attribute name="Sealed" value="false"/>
>
> </section>
>
> </manifest>
> </jar>
>
> </target>
>
>
> </target>
>
>  <target name="run" depends="jar">
>
>    <java classname="ie.dit.comp.AntTool.main.AntTool" fork="true">
>          <classpath>
>                 <pathelement path='${xercesImpl}'/>
>                 <pathelement path='${xml-apis}'/>
>                 <pathelement path='${ant}'/>
>                 <fileset dir='${lib.dir}'/>
>            </classpath>
>            </java>
>
>
>  </target>
>
>
> Manifest:
>
> Manifest-Version: 1.0
> Ant-Version: Apache Ant 1.6.2
> Created-By: 1.4.2_04-b04 (Sun Microsystems Inc.)
> Built-By: xxx
> Main-Class: ie.dit.comp.anttool.AntToolMain
> Class-Path: files/ant.jar files/xercesImpl.jar files/xml-apis.jar
>
> Name: common
> Specification-Title: AntTool
> Specification-Version: Version 1
> Specification-Vendor:
> Implementation-Title: common
> Implementation-Version: D: 2005-02-15 T:13:29:52
> Implementation-Vendor: DIT
>
> Name: AntTool.jar
> Sealed: true
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message