ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Longie" <>
Subject Ant Jar + Manifest
Date Tue, 15 Feb 2005 13:46:55 GMT

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;


Here is part of the build.xml file;

<target name="jar" description="JARs the Task" depends="compile">
<jar destfile="lib/${}.jar" basedir="${classes.dir}">
<fileset dir="." includes="${images.dir}/**"/>
<fileset dir="." includes="files/**"/>
<attribute name="Built-By" value="${}"/>
<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"/>
<attribute name="Main-Class" value="ie.comp.main.AntTool"/>
<attribute name="Class-Path" value="${lib.dir}\${}.jar
${files.dir}\ant\ant.jar ${files.dir}\xerces\xercesImpl.jar
<section name="AntTool">
<attribute name="Sealed" value="false"/>


  <target name="run" depends="jar">
    <java classname="ie.dit.comp.AntTool.main.AntTool" fork="true">
	                <pathelement path='${xercesImpl}'/>
	                <pathelement path='${xml-apis}'/>
	                <pathelement path='${ant}'/>
	                <fileset dir='${lib.dir}'/>


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
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:
For additional commands, e-mail:

View raw message