tegz
asked on
how to create a jar file?
how do i package my program so that all my classes, images are in one file. I want to be able to double click on it and it to run on a java runtime enviroment.
I am also using jdbc connecter, do i need to put this is the package also?
I am also using jdbc connecter, do i need to put this is the package also?
http://java.sun.com/docs/books/tutorial/jar/basics/
So, for example, at the command line, you need to move into the directory with your files, e.g:
CD c:\directory\with\my\files
Then, run something like this:
JAR cf MyProgram.jar "inputFile1.class" "inputFile2.class" "image1.gif"
CD c:\directory\with\my\files
Then, run something like this:
JAR cf MyProgram.jar "inputFile1.class" "inputFile2.class" "image1.gif"
ASKER
im using: mysql-connector-java-3.0.1 1-stable-b in.jar
how do i put that in there too?
how do i put that in there too?
erm.. try this:
JAR cf MyProgram.jar "inputFile1.class" "inputFile2.class" "image1.gif" "mysql-connector-java-3.0. 11-stable- bin.jar"
?
JAR cf MyProgram.jar "inputFile1.class" "inputFile2.class" "image1.gif" "mysql-connector-java-3.0.
?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can use this library http://one-jar.sourceforge.net/
to supported executable jar that includes nested jars.
There is an eclipse plugin that uses this library at http://fjep.sourceforge.net/
to supported executable jar that includes nested jars.
There is an eclipse plugin that uses this library at http://fjep.sourceforge.net/
But it will run fine with the jdbc driver jar distributed seperately. This also reduces the size of your applications jar.