javaConfig: Returns a configuration object for initializing the Java...

Description Usage Arguments Value Author(s) References See Also Examples

Description

This integrates user arguments with default values to create an object containing the information to parameterize the Java Virtual Machine's and the Omegahat session's initial environments. The object includes a classpath specification, system properties for the JVM that can also be read by the Omegahat system to govern how its elements are instantiated and also a library path for loading shared libraries as JNI code for Java classes.

Usage

1
2
3
4
javaConfig(classPath=character(0), properties=character(0),
           libraryPath=character(0), options=character(0),
           default=if (exists(".javaConfig")) .javaConfig
                   else JavaConfiguration())

Arguments

classPath

a character vector identifying locations of Java classes in the form of URLs, Jar files or simple directories. This is passed to the JVM as the argument to classpath. \ If this is not specified, the environment variable CLASSPATH is queried and if this set, its elements are prefixed to the default ones.

properties

a named character vector of system properties that are passed to the JVM initialization as -Dname=value for each element.

libraryPath

a character vector identifying directories which are to be used by Java when loading shared libraries/DLLs via System.loadLibrary()

options

a character vector of strings that are passed as is to the initialization of the virtual machine. These are basically non-property command line arguments that one can pass when starting the Java virtual machine in the usual way (e.g. calling the java executable). These include arguments such as mx of specifying the maximum amount of memory (e.g."-Xmx128m" for 128 megabytes), verbose option (e.g. "-verbose" or "-verbose:gc,class"), etc. See the documentation for your JVM or "The Java Native Interface" by Sheng Liang (page 250–251) or any JNI book.

default

a list containing the default values for each of the 3 fields/groups of parameters to which are added the user-specified values in the corresponding earlier arguments.

Value

A list that can be used to customize the initialization of the Java Virtual Machine embedded within the R session.

classPath

a character vector whose elements are sources of Java class files. These can be directories, URLs or Jar files (or any other form understood by the JVM). This is collapsed and specified as the value of the classpath argument to the JVM initialization.

properties

a named character vector whose values correspond to name=value pairs that are passed to the JVM as system properties in the form -Dname=value.

libraryPath

a character vector whose elements specify directories which are searched by the JVM when loading native code for a Java class via the System.loadLibrary() method.

Author(s)

John Chambers, Duncan Temple Lang

References

http://www.omegahat.org/RSJava

See Also

.JavaInit mergePath mergeProperties .javaConfig

Examples

1
2
3
4
 javaConfig()
 javaConfig(classPath=c("/home/duncan/Java", "/home/duncan/xml.jar", 
                         paste(system.file("org","omegahat","Jars"),
                               "DataStructures.jar",sep="/")))

SJava documentation built on Oct. 5, 2016, 4:17 a.m.

Related to javaConfig in SJava...