jinit

0th

Percentile

Initialize Java VM

.jinit initializes the Java Virtual Machine (JVM). This function must be called before any rJava functions can be used.

Keywords
interface
Usage
.jinit(classpath = NULL, parameters = getOption("java.parameters"), ..., silent = FALSE)
Arguments
classpath
Any additional classes to include in the Java class paths (i.e. locations of Java classes to use). This path will be prepended to paths specified in the CLASSPATH environment variable.
parameters
character vector of parameters to be passed to the virtual machine. They are implementation dependent and apply to JDK version 1.2 or higher only. Please note that each parameter must be in a separate element of the array, you cannot use a
...
Other optional Java initialization parameters (implementation-dependent).
silent
If set to TRUE no warnings are issued.
Details

Stating with version 0.3-8 rJava is now capable of modifying the class path on the fly for certain Sun-based Java virtual machines, even when attaching to an existing VM. However, this is done by exploiting the way ClassLoader is implemented and may fail in the future. In general it is officially not possible to change the class path of a running VM. At any rate, it is impossible to change any other VM parameters of a running VM, so when using .jinit in a package, be generous with limits and don't use VM parameters to unnecessarily restrict resources. Also you should always respect the "java.parameters" option and update only setting if you really must.

Value

  • The return value is an integer specifying whether and how the VM was initialized. Negative values indicate failure, zero denotes successful initialization and positive values signify partially successful initilization (i.e. the VM is up, but parameters or class path could not be set due to an existing or incompatible VM).

Aliases
  • .jinit
Examples
## use "myClasses.jar" as the class path
.jinit(classpath="myClasses.jar")
Documentation reproduced from package rJava, version 0.4-14, License: GPL version 2

Community examples

Looks like there are no examples yet.