JpackIt 1.0.2 Help


1. Introduction

JPackIt is a tool which allows distributing of java application with all necessary resources as one executable package. Currently we support only jar archives as a destination format, but in future versions we are planning to introduce packaging into single class file as well. With help of JPackIt you will be able to include in final package all libraries that are necessary to run your application. Also any additional resources such as images, properties files, and encryption keys can be added to the package.

Destination package is executable and can be launched using usual “java –jar” command. JPackIt Application can be run in command-line mode or in graphic mode.


2. Basic concepts

Base directory
Directory which is root folder for all other directories and files involved in packaging process. All other paths should be given as relative paths to the base dir.
Main jar
Java archive that contains main application code. Main jar should include at least one executable class (with “main” method)
Dependant jars
All additional libraries and other resources that are necessary to run the application
Main class
Executable class from main jar that will be run when final package is executed
Package location
Directory where destination package will be created
Package name
Name of destination package
Package type
Format of package. Currently only “jar” value is supported
Predefined args
Mandatory arguments that will be passed to the main class when final package is executed. All user-defined arguments will be added AFTER predefined arguments
Default args
Arguments that will be added after predefined arguments (if any). User of your application can redefine them by manually setting other values during launching of final package (for example “java –jar app.jar –arg1 –arg2).

Important Notice. In order to use JPackIt you must first compress all application classes and other resources into jar file. That jar file is referred as “main jar”.


3. Graphic tool

To start JPackIt in graphic mode use “java –jar jpackit-1.0.2.jar”.

In order to create new package you should specify base dir, main jar and main class, package name and location. You can save your package configuration in file or load previously stored configuration. To create package with parameters specified in form fields use “Build” -> “Build package” menu item. Prior to building a package, system will check that all parameters are given, that they are correct and that package can be created. If verification fails you will see errors description in separate window. In this case fix errors and try to build package again. You can validate configuration manually by using “Build” -> “Validate” menu.


4. Command-line tool

If you want to use JPackIt in silent mode with already created configuration file, you can use command-line version of it. Command-line version takes configuration file as a first argument. You can create configurations using graphic tool or manually with any text editor. Full syntax of JPackIt command-line tool is:

java –jar jpackit-cmd-1.0.2.jar <config_file> (<base_dir> <package_name> <main_jar>)

where arguments are:

config_file
full path to configuration file
base_dir
base directory (optional)
package_name
package name (optional)
main_jar
main jar (optional)