JavaCreateJavaVM Function

Action

Initializes and starts the Java Virtual Machine (JVM). Silk Performer requires the JVM from Sun Microsystems.

Include file

Java.bdh

Syntax

JavaCreateJavaVM( in nVersion   : number optional ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
nVersion

Version number of the Java Virtual Machine (optional). This parameter can be one of the following:

  • JAVA_V1. Java 1 Platform (Java 1.1.x)

  • JAVA_V2. Java 2 Platform (Java 1.2.x and later versions)

By default, the VM version, specified by the profile settings, is used.

Note: The JavaSetOption function overrides the profile setting.

Example

dcltrans
  transaction TInit
  begin
    JavaSetOption(JAVA_VERSION, JAVA_V17);
    JavaSetOption(JAVA_HOME, "c:/Program Files/Java/jdk1.7.0");
    JavaSetOption(JAVA_CLASSPATH, "c:/myApplication/classes;c:/myTools/tools.zip");
    JavaCreateJavaVM();
    JavaUserInit("SilkPerformerUser");
  end TInit;

  transaction TRun
  begin
    JavaUserRun();
  end TRun; 

  transaction TMyTransaction
  begin
    JavaUserMethod("MyMethod");
  end TMyTransaction; 

  transaction TShutdown
  begin
    JavaUserShutdown();
  end TShutdown;