Setting the CLASSPATH for Java Applications

There are two ways to set the CLASSPATH of a Java application:

The first method is recommended because it does not modify the desktop.

Note
: Regardless of the method you choose, the Arguments property of the Windows application adapter must contain the class name (without the extension). Also keep in mind that the paths set on Studio and on Runtime must be identical.
 

CLASSPATH Set in Studio

This is the recommended method because it does not modify the desktop. A Java application uses a Windows Application adapter. To set the path argument in Studio, perform the following steps:

  1. Open the Properties window for the Windows Application adapter.

  2. Do one of the following in the Arguments property:

  3. If CLASSPATH is not already set as an environment variable or if you want to override the CLASSPATH environment variable, type -classpath "the location of the Java application" class name (without an extension)

  4. If CLASSPATH is already set as an environment variable, type only the class name (without an extension) .

 

CLASSPATH set in Windows

You only need to add the CLASSPATH for a particular application once and you can add multiple applications at the same time. To set the environment variable for the CLASSPATH of a Java application, begin by opening the Windows Control Panel. Then follow these steps, which reflect Windows 7.

  1. In Control Panel, select System and Security > System. Then click Advanced system settings. The System Properties dialog opens.

  2. Click Environment Variables. The Environment Variables window is displayed.

  3. Click New in the System variables area. The New System Variable window is displayed.

  4. Enter classpath in the Variable name field. It is case sensitive.

  5. Enter the location of the Java applications in the Variable value field. If you are listing more than one, separate each with a semicolon (;).

  6. Click OK. The new variables and values appear in the System variables area.

  7. Add the class name to the Windows Adapter Arguments property as if it were already set as an environment variable..

  8. Restart Studio and Runtime.

 

Related information

Interrogating a Java Application

Interrogating a Java Applet


Privacy | Trademarks | Terms of Use | Feedback

Updated: 18 June 2020

© 2016 - 2020 Pegasystems Inc.  Cambridge, MA All rights reserved.

 

OpenSpan data classification label