• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 194
  • Last Modified:

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?
0
tegz
Asked:
tegz
1 Solution
 
InteractiveMindCommented:
0
 
InteractiveMindCommented:
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"
0
 
tegzAuthor Commented:
im using: mysql-connector-java-3.0.11-stable-bin.jar

how do i put that in there too?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
InteractiveMindCommented:
erm.. try this:

   JAR cf MyProgram.jar "inputFile1.class" "inputFile2.class" "image1.gif" "mysql-connector-java-3.0.11-stable-bin.jar"

?
0
 
objectsCommented:
> im using: mysql-connector-java-3.0.11-stable-bin.jar
> how do i put that in there too?

You'll need to supply that jar seperately and reference it in the Class-Path: attribute in your MANIFEST
0
 
aozarovCommented:
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/
0
 
objectsCommented:
But it will run fine with the jdbc driver jar distributed seperately. This also reduces the size of your applications jar.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now