Deliver Your Java Application in One-JAR™!

Copyright 2004-2007 by P. Simon Tuffs, All Rights Reserved.





Quick Links:

download one-jar SDK

one-jar at sourceforge.net

simontuffs.com

licensing information

SourceForge.net Logo

Getting Started

To get started building an application using One-JAR, download the One-JAR Software Developers Kit. The kit is a One-JAR executable, which contains all the pieces needed to assemble One-JAR applications (and can also re-assemble itself). When run, should see the following output:
$ java -jar one-jar-sdk-0.96.jar
Extracting SDK... done.  
To build the "Hello One-JAR" example: $ ant hello
To run the "Hello One-JAR" example:   $ java -jar hello.jar
To rebuild the SDK:                   $ ant sdk
This extracts a development project (also an Eclipse JDT project) which contains a directory tree suitable for building a One-JAR application.

Note: make sure to download an Ant distribution in order to be able to rebuild the hello.jar or the sdk. You can obtain the latest version of ant here: http://ant.apache.org/bindownload.cgi. Alternatively run Ant from within an IDE such as Eclipse. You will also need a Java Runtime JRE 1.4 or later.

$ ant hello builds a simple One-JAR Jar file containing a single Main class, and a single Hello class. The Main class is bundled into main.jar, the Hello class is bundled into hello.jar, and the requisite One-JAR jar-file is constructed. Main invokes Hello(), which prints "Hello One-JAR".

Use this project as a starting point for your own development by editing the hello target in the build.xml file extracted above. Clone the build.xml file, and strip out the sdk target since you will not be rebuilding it as part of your application.


If you like One-JAR then you might want to check out some of the other Open-Source projects developed by simontuffs.com:
soap-stone at sourceforge.net XML Instance Generator Eclipse JAR Plugin Yet Another Compiler Compiler Language