Chapter 5. Jamaicavm Commands

Table of Contents
jamaicavm
jamaicavm_slim
jamaicavmp
jamaicavmdi

The Jamaica virtual machine provides a set of commands that permit the execution of Java applications by loading a set of class files and executing the code.

The jamaicavm is the standard Jamaica virtual machine. Its variants jamaicavm_slim, jamaicavmp and jamaicavdi are provide special features like debug support.

jamaicavm

The jamaicavm is the standard command to execute non-optimized Java applications in interpreted mode.

Usage: jamaicavm      [<options>] [--] <class>   [args...]
   or  jamaicavm -jar [<options>] [--] <jarfile> [args...]

The jamaicavm permits a number of options followed by a class name or a Java archive file if option -jar is present. The class uses dots (`.') as package separators and does not include the .class extension, i.e., to execute the Java application whose main class in in file com/mycompany/MyClass.class (or com\mycompany\MyClass.class on Windows systems), the class argument must be com.mycompany.MyClass. An optional `--' can be used to explicitly separate the options from the class or jar file argument.

JamaicaVM Options

-classpath <classpath> or -cp <classpath>

The classpath option sets search paths for class files. The argument must be a list of directories or JAR/ZIP files separated by the platform dependent path separator char (`:' on Unix-Systems, `;' on Windows).

-D<name>=<value>

The D option sets a system property with a given name to a given value. The value of this property will be available to the Java application via functions such as System.getProperty()

-version

The version option prints version of JamaicaVM.

-help / -?

The help option prints a short help summary on the usage of JamaicaVM.

-xhelp / -X

The xhelp option prints a short help summary on the extended options of JamaicaVM.

JamaicaVM Extended Options

JamaicaVM supports a number of extended options. Some of them are supported for compatibility with other virtual machines, while some provide functionality that is only available in Jamaica.

Please note that the extended options may change without notice. Use them with care.

-Xbootclasspath:<bootclasspath>

The Xbootclasspath option sets bootstrap search paths for class files. The argument must be a list of directories or JAR/ZIP files separated by the platform dependent path separator char (`:' on Unix-Systems, `;' on Windows).

Note that the jamaicavm command has all boot and standard API classes built in. The boot-classpath has the built-in classes as an implicit first entry in the path list, so it is not possible to replace the built-in boot classes by other classes which are not built-in. However, the boot class path may still be set to add additional boot classes.

For commands jamaicavm_slim, jamaicavmp, etc. that do not have any built-in classes, setting the boot-classpath will force loading of the system classes from the directories provided in this path. However, extreme care is required: The virtual machine relies on some internal features in the boot-classes. Thus it is in general not possible to replace the boot classes by those of a different virtual machine or even by those of another version of the Jamaica virtual machine or even by those of a different Java virtual machine.

-Xms<size> / -ms<size>

The Xms option sets initial Java heap size, the default setting is 2M. This option takes precedence over a heap size set via an environment variable.

-Xmx<size> / -mx<size>

The Xmx option sets maximum Java heap size, the default setting is 256M. This option takes precedence over a maximum heap size set via an environment variable.

-Xmi<size> / -mi<size>

The Xmi option sets heap size increment, the default setting is 4M. This option takes precedence over a heap size increment set via an environment variable.

-Xss<size> / -ss<size>

The Xss option sets stack size (native and interpreter). This option takes precedence over a stack size set via an environment variable.

-Xjs<size> / -js<size>

The Xjs option sets interpreter stack size, the default setting is 64K. This option takes precedence over a java stack size set via an environment variable.

-Xns<size> / -ns<size>

The Xns option sets native stack size, set default setting is 64K. This option takes precedence over a native stack size set via an environment variable.

-Xprof

Collect simple profiling information using periodic sampling. This profile is used to provide an estimate of the methods which use the most CPU time during the execution of an application. During each sample, the currently executing method is determined and its sample count is incremented, independent of whether the method is currently executing or is blocked waiting for some other event. The total number of samples found for each method are printed when the application terminates.

Note that compiled methods may be sampled incorrectly since they do not necessarily have a stack frame. We therefore recommend to use Xprof only for interpreted applications.

Environment variables used by JamaicaVM

Next to the command line options, JamaicaVM also permits the specification of options via environment variables. The following table lists the environment variables and their meanings.

Table 5-1. Environment variables used by JamaicaVM

Variable NameDescription
CLASSPATHPath list to search for class files.
JAMAICA_SCHEDULING

Select native thread scheduling mode (for Linux and Solaris only):

  • OTHER -- default scheduling

  • RR -- round robin

  • FIFO -- first in first out

JAMAICAVM_HEAPSIZEHeap size in bytes, default 2M
JAMAICAVM_MAXHEAPSIZEMax heap size in bytes, default 256M
JAMAICAVM_HEAPSIZEINCREMENTHeap size increment in bytes, default 4M
JAMAICAVM_JAVA_STACKSIZEJava stack size in bytes, default 64K
JAMAICAVM_NATIVE_STACKSIZENative stack size in bytes, default 64K
JAMAICAVM_NUMTHREADSMaximum number of Java threads, default: 10
JAMAICAVM_FINALIZERPRIThe Java priority of the finalizer thread. This thread executes the finalize method of objects before their memory is reclaimed by the GC. default: 10
JAMAICAVM_PRIMAPPriority mapping of Java threads to native threads
JAMAICAVM_ANALYSEEnable memory analysis mode with a tolerance given in percent (see Builder option analyse), default: 0. (disabled)
JAMAICAVM_RESERVEDMEMORYSet the percentage of memory that shold be reserved by a low priority thread for fast burst allocation (see Builder option reservedMemory), default: 10.
JAMAICAVM_SCOPEDSIZESize of scoped memory, default: 0
JAMAICAVM_IMMORTALSIZESize of immortal memory, default: 32768
JAMAICAVM_LAZYUse lazy class loading/linkage (1) or load/link all classes at startup (0), default: 1.
JAMAICAVM_STRICTRTSJUse strictRTSJ rules (1) or relaxed Jamaica rules (0), default: 0
JAMAICAVM_PROFILEFILENAMEFile name for profile, default: <class>.prof