Arbortext Command Language > set Command Options > set javavmpath
  
set javavmpath
set javavmpath= { vmpath}
This command specifies the type and location of the Java Virtual Machine (JVM) to use when calling Java classes from Arbortext Editor.
This command can be set to either a full path (vmpath).
* 
The environment variable APTJAVAVMPATH specifies the path of the Java Runtime Environment installation. If this environment variable is set, it takes precedence over a set javavmpath command.
If the option is set to a full path (vmpath), then Arbortext Editor uses the specified JVM for the current session.
If this option is not set, Arbortext Editor checks the Windows registry to locate an Oracle JVM. If this check is not successful, then Arbortext Editor will have no JVM available and will return an error if you attempt to invoke Java code from within Arbortext Editor.
The setting for javavmpath is only evaluated when the first java_type function is called in an Arbortext Editor session. Subsequent changes to set javavmpath will not affect the running Java Virtual Machine unless you exit Arbortext Editor and start a new session. Consequently, when using the java_type functions, you should set javavmpath before invoking a java_type function.
Examples:
set javavmpath=msjava.dll
If set javavmpath is used with Arbortext Publishing Engine, you should protect it from being sourced again after the JVM has started. Put the set javavmpath statement inside an appropriate if statement. For example:
# Try to change this value only if the JVM has not started yet.
# This protects from failure in case this file is sourced again
# after the JVM has already started.
if (!java_init()) {
set javavmpath="D:\jre\lib\jvm.dll"
}
Related Topics
java_init function
java_constructor function
java_instance function
java_static function
java_delete function
append_javaclass_path function
set javaclasspath command
set javadebugport command
set javavmargs command
set javavmmemory command