Java Application and Libraries in a single JAR !

So you have created a java application that use .JAR libraries,But you need to put all the stuff into a single JAR ! That’s when the One-JAR comes to your aid.

What is One-JAR?

One-JAR lets you package a Java application together with its dependency Jars into a single executable Jar file.

You can download and read more information about it here : http://one-jar.sourceforge.net/

How to use it : download “one-jar-boot-x.xx.jar” from http://one-jar.sourceforge.net/index.php?page=downloads&file=downloads

Extract the downloaded jar file. Delete the src folder(if you want).
Free Image Hosting at www.ImageShack.us
Rename your application’s main jar file to main.jar
Free Image Hosting at www.ImageShack.us
Put the main.jar file in a folder called “main”
Free Image Hosting at www.ImageShack.us
Copy your Application’s libraries to a folder called lib
Free Image Hosting at www.ImageShack.us
Now select all files in extract path and compress them to a zip file.
Free Image Hosting at www.ImageShack.us
Rename the zip file to your_app.jar (your_app can be anything you like, make sure you change the extension) Now its all done. run and see if it works.
Free Image Hosting at www.ImageShack.us

Leave a Reply

Your email address will not be published. Required fields are marked *