Java environment variables settings

This section describes the environment variables that need to be set when you load your Java application with UFT Java Add-in support. You need to set one or more environment variables to the path name of the Java Add-in support classes folder.

  1. Set the _JAVA_OPTIONS environment variable (Oracle) or the IBM_JAVA_OPTIONS environment variable (IBM) as follows:

    Xbootclasspath/a:"C:\Program Files (x86)\HPE\Unified Functional Testing\bin\java_shared\classes\jasmine.jar

    The above settings should appear on one line (no newline separators).

  2. If you are working with Oracle Java 6 or 7 (versions 1.6 or 1.7), you must set an additional environment variable, JAVA_TOOL_OPTIONS, with the value -agentlib:jvmhook

    Tip: If needed, you can temporarily remove Java support by renaming the _JAVA_OPTIONS or IBM_JAVA_OPTIONS environment variable. (If you are working with Java 6, you need to rename the JAVA_TOOL_OPTIONS environment variable as well.) For example, you must remove Java support if you want to test ActiveX controls that are embedded in SWT- or Eclipse-based applications.

  3. You can override the values in the Executable file, Command line, and Working directory boxes in the Java Tab (Record and Run Settings Dialog Box) by defining the Java application details using the following variables:

    Option

    Variable Name

    Description

    Executable file

    EXEPATH_ENV

    The executable file or a batch file to open.

    Command line

    CMDLINE_ENV

    The command line to use to open the file.

    Working directory

    WORKDIR_ENV

    The folder to which the specified command line or executable file refers.

You can also use short paths in these commands. For example:

-Xbootclasspath/a:C:\PROGRA~2\
HPE\UNIFIE~1\bin\JAVA_S~1\classes\jasmine.jar 

In this example, UFT is installed in the default installation folder (C drive, Program Files) on a Windows 7 computer. PROGRA~2 denotes the Program Files (x86) folder, which is the Program Files folder on 64-bit operating systems.