JStart is a cross-platform bootstrap loader for Java. It is available to both Checkpoint and non-Checkpoint applications, providing a superior replacement for the shell scripts often found in this role.
The conventional way to launch a Java application is to use a shell script (batch file on win32) to invoke the Java VM loader program, while providing it with the rather large number of parameters it typically requires. However, this has a number of disadvantages:
JStart addresses these issues by replacing the scripts with a conventional executable, which reads parameters from a separate configuration file. JStart then uses the Java Invocation API to start the VM inside the JStart process itself.
Actually this is only currently true on win32; the unix JStart is actually a shell script which invokes the ordinary java bootloader. This is for compatibility: the "bootloader" on unix is sometimes itself a complex script which does Strange Things and is best left alone. Due to the semantics of process invocation on unix, this doesn't cause problems, although it would on win32.
Win32/x86 and Linux/x86 (recent distros) are supported. Java 1.4 - Java 6 only. We intend to port to Solaris/SPARC and Mac OS X when resources permit; interested hackers would be needed for ports to other platforms. It is conjectured that the Linux version of JStart should work as-is on other flavours of unix, and on OS X.
On unix, java must be available on the system PATH. The Java installation process (whatever that is for your version of unix) will usually see to it that this happens. If not, get your sysadmin to provide a suitable symlink.
Syntax: jstart [-version] [-f bootname] [args]
-version
: Prints the version of JStart and then exits. This
must be the only parameter supplied. -f bootname
: Load parameters from the file, which
is located in the same folder as the executable, and whose name is
bootname.boot
. The format of this file is described in
the next section. If this option is omitted, bootname is taken as the
name of the executable itself. If, only in this "implicit" case (and not when an
explicit -f
parameter is supplied), no matching boot file is found,
then the executable name is converted into lowercase, and this version is used
as the bootname. This is a compatibility feature for case-insensitive
filesystems.args
A set of space-delimited command-line arguments.
These are passed through verbatim to the Java app. They come after any arguments
specified in the configuration file.
JStart requires a set of parameters, which are contained in a .boot
file. This file is a standard ASCII text file, with either CR/LF or LF line
termination (DOS or unix, respectively). There are no limits (apart from memory)
upon line lengths within this file.
Valid line formats are as follows.
#
character.-title string
: On win32, the title for the
console window. Only one must be specified.-noconsole
: On win32, the Java console is destroyed just
before invoking the main
method of the specified class. On unix,
this has no effect. YMMV with apps which send output to the console, since
there isn't one.-vm variant
: specify which variant of the VM to
use. For Sun JVM's, the valid options are client
(the default)
or server
.-classpath path
: the path specified by
path
will be added to the class path. Use unix-style
forward slash as the directory marker, rather than win32-style backslash. Use
one -classpath
entry for each path (thus, you don't need to worry
about whether to use unix-style ":" or windows-style ";" path separators). -runclass [package[.subpackage]].classname
The class
whose main
method will be invoked. Exactly one must be specified.-cpclassload
Use the Checkpoint loader. Checkpoint
applications will usually need this, others won't. More details below.-arg string
: specify a command-line argument. These
are supplied to the java app in the order in which they appear in the file.
Arguments which appear here precede any supplied as additional arguments on
the JStart command line.-Dname=value
for properties,
-Xstring
for VM-specific extensions etc.-classpath path
) this must be
exactly one space character. No variants or other whitespace
are permitted.-X
non-standard extensions unless essential (or
debugging).[If the rest of this section makes no sense, you don't want the Checkpoint loader: don't specify it.]
The Checkpoint loader allows Checkpoint applications to load classes using Checkpoint's library mapping mechanism to specify jar files. This is often easier to manage and less error-prone than listing all the required jars in the classpath.
To use the Checkpoint loader, Checkpoint's loader.jar
must be specified
on the classpath. Other library jars, especially checkpoint.jar
,
MUST NOT appear on the classpath.
The library mapping mechanism uses a set of map files, located in the
lib
subfolder of the Checkpoint installation, to define jars (also
located in the lib
subfolder) which should be loaded.
Each map file ends with a .map
extension and is a line-oriented
text file formatted as follows.
target=
followed by a comma-separated list of fully-qualified
names of executable classes (runclasses) for which this map file is relevant
(and should be loaded). The special target __KERNEL__
is always
relevant.-
<tag>=
jarname.
In this definition:
*
signifies any java version, and is the most usual
setting. Note that Java 5 thinks it's called 1.5
, and this is the
javaversion you should use.
JStart builds a classpath using only the paths you specify using
-classpath
statements in the .boot
file. It ignores
any CLASSPATH environment variable, and leaves it up to the VM itself to
locate the standard classes in rt.jar
etc. (Modern VM's can do
this quite happily; older 1.1 VMs sometimes needed to be spoon-fed). The VM
may itself take up any CLASSPATH variable, so consider unsetting this if you
get problems. Paths will appear on the classpath in the same order as the
-classpath
statements appear in the .boot
file.
The "at" character @
will, anywhere it appears in the .boot
file, be replaced with the name of the folder which contains the executable.
This allows relative paths to be converted into absolute ones at runtime,
giving greater robustness (Java doesn't really have the concept of a current
working directory). The replacement does not include the terminating separator,
so the correct form is @/../lib
rather than @../lib
.
To include a literal @
character, escape it by writing it twice,
thus @@
.
No other expansions or replacements (e.g. environment variables) are available.