JVM Option Settings

The JavaSetOption(<option id>, <option string>) BDL function can be used to determine options such as Java version, the Java home directory, and the class path. This function and the allowed option identifiers are defined in the Java.bdh file.

It is recommended that you set Java options in the profile settings. When Java options are set in both profile settings and BDL the settings made in BDL take precedence.

注: When using the Eclipse plug-in, the Java settings defined in Eclipse have precedence over all other settings.

Option Identifiers

  • JAVA_VERSION - (must be defined) Determines the JVM version (1.1.x, 1.2.x, 1.3.x, or 1.4.x).
  • JAVA_HOME - (recommended) Determines the installation directory of the JVM that should be used for replay. Loading of the JVM is independent of the PATH environment, so it is possible to switch between JVMs without changing the system PATH environment.
  • JAVA_CLASSPATH - (recommended) Determines the class path for the JVM. The system class path is appended by default (-classpath).
  • JAVA_DLL - Allows you to specify an individual DLL file path for implementing the JVM that is to be loaded.
  • JAVA_VERBOSE - Enables the verbose option (-verbose) of the JVM. By default, this option is disabled.
  • JAVA_DISABLE_COMPILER - Disables the JIT (Just In Time compiler) of the JVM. By default the JIT is enabled.
  • JAVA_CMDLINE_OPTIONS - Enables you to specify any commandline options that are to be passed to the JVM.
  • JAVA_USE_SYSTEM_CLASSPATH - Determines that the system class path should be appended. By default it is appended.
  • JAVA_DESTROY_JVM_ON_SHUTDOWN - When not set (the default), the current thread is detached from the JVM upon shutdown, but the JVM is not destroyed. When the option is set, all Java threads are killed and the JVM is destroyed upon shutdown. Note that to do this, JVMDI must be enabled by setting -Xdebug -Xnoagent -Djava.compiler=NONE in the commandline options.
  • JAVA_SUPPRESS_EXCEPTIONS – When not set (the default), Java exceptions raise BDL errors. When set, Java exceptions are suppressed and must be checked manually using the JavaGetLastException() command

Examples

  • JavaSetOption(JAVA_VERSION, JAVA_V14); // JVM v1.4.x

    JavaSetOption(JAVA_HOME, "j2sdk1.4.0_01");

    JavaSetOption(JAVA_CLASSPATH, "c:/myApplication/classes;c:/myTools/tools.zip");

    JavaSetOption(JAVA_DISABLE_COMPILER, YES);

    JavaSetOption(JAVA_CMDLINE_OPTIONS, ENABLE_JVMDI);