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 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.
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).
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
The version option prints version of JamaicaVM.
The help option prints a short help summary on the usage of JamaicaVM.
The xhelp option prints a short help summary on the extended options of JamaicaVM.
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.
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.
Please note that JAR/ZIP file loading in JamaicaVM is implemented in Java. This means that the boot classes themselves may not be packed into a JAR or ZIP archive since the virtual machine alone cannot unpack these archives.
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.
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.
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.
The Xss option sets stack size (native and interpreter). This option takes precedence over a stack size set via an environment variable.
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.
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.
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 for each 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.
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 Name | Description |
|---|---|
| CLASSPATH | path list to search for class files. |
| JAMAICA_SCHEDULING | Select native thread scheduling mode (for Linux and Solaris only):
|
| JAMAICAVM_HEAPSIZE | heap size in bytes, default 2M |
| JAMAICAVM_MAXHEAPSIZE | max heap size in bytes, default 256M |
| JAMAICAVM_HEAPSIZEINCREMENT | heap size increment in bytes, default 4M |
| JAMAICAVM_JAVA_STACKSIZE | Java stack size in bytes, default 64K |
| JAMAICAVM_NATIVE_STACKSIZE | native stack size in bytes, default 64K |
| JAMAICAVM_NUMTHREADS | maximum number of Java threads, default: 10 |
| JAMAICAVM_FINALIZERPRI | The 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_PRIMAP | priority mapping of Java threads to native threads |
| JAMAICAVM_ANALYSE | Enable memory analyze mode with a tolerance given in percent (see Builder option analyse), default: 0 (disabled) |
| JAMAICAVM_RESERVEDMEMORY | Set the percentage of memory that shold be reserved by a low priority thread for fast burst allocation (see Builder option reservedMemory), default: 10 |
| JAMAICAVM_SCOPEDSIZE | size of scoped memory, default: 0 |
| JAMAICAVM_IMMORTALSIZE | size of immortal memory, default: 32768 |
| JAMAICAVM_LAZY | Use lazy class loading/linkage (1) or load/link all classes at startup (0), default: 1 |
| JAMAICAVM_STRICTRTSJ | Use strictRTSJ rules (1) or relaxed Jamaica rules (0), default: 0 |
| JAMAICAVM_PROFILEFILENAME | Set file name for profile, default: <class>.prof |