ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: Class path error
Date Wed, 14 May 2008 04:58:37 GMT
A startable JAR file (java(w) -jar my.jar; doubleclick on the jar) needs two information:
- which class to start
- additional classpath entries
These information are made in the META-INF/ in
- Main-Class: package.Driver_1
- Class-Path: path/one.jar path/two.jar
Ant's <jar> with nested <manifest> can build that jar.

Relative paths specified in Class-Path manifest entry are relative to the jar file itself.
This means for the example above that you have a directory layout like this:
   \- place
         \-- path

For creating the needed Class-Path have a look at the <manifestclasspath> task.
The creation of the required directory layout just use <mkdir> and <copy>.


> -----Urspr√ľngliche Nachricht-----
> Von: Van Dessel Ivan [] 
> Gesendet: Dienstag, 13. Mai 2008 19:41
> An:
> Betreff: Class path error
> To run my project correctly I run "java package.Driver_1" after I run 
> command "source" on a script file that exports two directories of jar 
> files.  How do I implement the exporting of library jars into 
> my build 
> file for ant to make a jar file so that  I can just run it. I 
> have been adding
> attribute="Class-Path" refid="path/.jar path/.jar" into the 
> Manifest but it still
> is giving me errors by running the jar like this "java -jar 
> jarfile"  ?
> Ivan Van Dessel
> Systems Engineer
> Advanced Acoustic Concepts
> 900 Technology Blvd., Suite C
> Bozeman, MT  59718
> (Phone) 406.582.8133
> (Fax) 406.582.0151 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message