Skip to main content

Java Configuration

Expand a Java custom virtual user (VU) in the Workspace tree and click Java Configuration to open the configuration options view:

Java tab

Command Line Options

Java custom VU profiles have the additional option of setting command line parameters.

  • Compile (javac) command line options: Any parameters entered in this box will be passed to the java compiler (javac.exe) when you Build the Workspace.
  • Runtime (java) command line options: Any parameters entered in this box will be passed to each Java Virtual Machine instance (java.exe) when you start a test.

For help generating Runtime Java command line options, use the gear icon in the bottom right corner of the Command Line Options area:

Java CLI Gear Icon

This will bring up the Java Runtime Command Line Options dialog:

Java Runtime CLI Options

All selections are optional:

  • Initial Memory Allocation (Xms n): Specify an initial memory allocation amount. In bytes by default. To change the unit, click the drop-down list to the right of the field, and choose from bytes (default), kilobytes (k), megabytes (m), and gigabytes (g).
  • Maximum Memory Allocation (Xms n): Specify a maximum memory allocation amount. In milliseconds by default. To change the unit, click the drop-down list to the right of the field, and choose from bytes (default), kilobytes (k), megabytes (m), and gigabytes (g).
  • Maximum GC Pause Time (XX:MaxGCPauseMilis): Specify a maximum pause time in milliseconds.
  • User-defined Settings: Optional ability to define other settings here.

For more information about these options, see the Oracle Java tools reference.

Click OK. The Command Line Options in the Java tab will be automatically populated with the information specified:

Java CLI Options Populated

Class Path

Any .jar files listed in the Class path table can be added to the class path at various points during the development process.

Click the AddButton Add button, then select one or more .jar files in the Browse window which appears.

note

For portability, .jar files you add to the Class path table are automatically copied to your workspace directory, and can be found in the files/ folder. This means that when you export your workspace or move it to a different location, the .jar files remain with it. The paths listed in the Class path table reflect the new location of the .jar files after copying.

For each jar, there are three options available:

  • Transfer to injector: The jar will be transferred to each injector at the start of the test.
  • Add to build class path: The jar will be added to the class path that is used by javac.exe when you Build the Workspace
  • Add to runtime class path: The jar will be added to the class path of each JVM when you run a test

In most cases all three options should be checked.

To remove a .jar file from the Class path table, click the RemoveButton Remove button.

Environment tab

This tab allows you to provide any environment variables that you will need to access from your Java custom VU scripts. Any environment variables specified in this area will be passed to the engine processes running on each injector.

Click the green plus sign in the upper right corner of the Environment tab to add an environment variable.

To read more about the Environment tab and specifying environment variables, see Setting Runtime Environment Variables.