Deliver Your Java Application in One-JAR™!

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

SDK Approach

Note: this approach is deprecated in favor of the Application Generator

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: 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
Get One-JAR(TM) at Fast, secure and Free Open Source software downloads soap-stone at Eclipse JAR Plugin Yet Another Compiler Compiler Language