Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ant manifest problem

Status
Not open for further replies.

dexter195

Programmer
Joined
Jun 18, 2003
Messages
220
Location
EU
hi,
im creating a jar file using ant. this will create the jar file but the problem is that i need to pass the following information into the file.
-cp .;C:\j2sdk1.4.2_05\jre\lib\ext\mysql-connector-java-3.0.15-ga-bin.jar TestWebBrowser

TestWebBrowser is the name of the client file.

how can i pass these arguments into the jar file. do i need to this in the manifest file or the build file??? ive tried everyting and i cant find any examples of this being done.

thanks for your help

dex
 
You want to set the classpath in the manifest by ant,
and the Main-Class?
Here is an example:
Code:
target name="jar" depends="variables, bin, jarclean" description="make archiv with main-class (startable)" >
	<echo message="make love, not jar :) "/>
	<jar
		jarfile="${ARC}"
		basedir="${bin}"
		index="true">
		<manifest>
			<attribute
				name="Main-Class"
				value="${MAIN}"/>
		</manifest>
	</jar>
</target>
in 'variables', I define ${MAIN}, ARC, and bin.
I guess you only need to modify these, and create an additional attribute, name 'Class-Path' (check the spelling).

seeking a job as java-programmer in Berlin:
 
cheers but what i need to do is pass arguments into the jar as im creating it.
im linking the app to a mysql database so i need to pass the following into it to make the connection

C:\j2sdk1.4.2_05\jre\lib\ext\mysql-connector-java-3.0.15-ga-bin.jar

thanks

dex
 
ive got it fixed. i need to put the following code into the manifest file
Class-Path: ..\mysql-connector-java-3.0.15-ga-bin.jar

thanks for your help stefanwagner

dex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top