Invoking JRE Applications

Once you set CLASSPATH for testing standalone Java applications, you are ready to invoke your application using the Java Runtime Environment (JRE).

Note: The JRE ignores the CLASSPATH environment variable. As a result, you must invoke JRE applications with command line arguments to pick up the value of CLASSPATH.

The following table describes the commands you can use:

Command Description
-cp Searches first through directories and files specified, then through standard JRE directories.
-classpath

Ignores the value of your CLASSPATH environment variable. You must specify a complete search path on the command line.

Does not search the standard JRE directories.

To invoke JRE applications using -cp

Enter the following command:
jre -cp %CLASSPATH%;<other directories, if any> <name of application>

Example

Assuming your CLASSPATH is set to the complete search path including the Java support path, you would launch the application MyJREapp by entering:
jre -cp %CLASSPATH% MyJREapp