Jview Reference Previous
Previous
About Tools
About Tools
Index
Index
Next
Next

Introduction to Jview

Description of Jview Syntax , Using Jview.exe , Reference to Jview Command-Line Options

Jview.exe (jview) is a tool used to execute Java applications from the command line. Jview provides an environment in which your application can run. It supports both debug and retail versions of your application.

Jview currently does not support pure Java applets. If your Java project has a main method, then jview will execute it. This includes all Java applications. For an alphabetic reference to the jview options see Reference to Jview Command-Line Options.


Description of Jview Syntax

The Jview.exe (jview) command line uses the following syntax.

jview [options] <classname> [arguments]

The following table describes input to the jview command.
Entry Meaning
options One or more jview options. See Reference to Jview Command-Line Options for more information.
classname The name of the .class file to execute. Do not include the .class extension to this filename. For example, use HelloWorldApp and not HelloWorldApp.class.
arguments Command-line arguments to be passed to the .class file supplied in classname parameter.

Note Any options that you want to supply to jview must be supplied before the name of the .class file or they will be interpreted as command-line arguments to the .class file.


Using Jview.exe

You can specify Jview.exe (jview) options on the command line. If you are executing your Java application from the command line, enter the options you want to supply to jview before the name of your .class file on the command line.

Note Jview will run only Java applications. To use jview for executing your application, your class must contain a main method. If your program is an applet, run it from a browser.


Reference to Jview Command-Line Options

This topic is an alphabetic reference to all the jview command-line options. If a command-line option can take one or more arguments, its syntax is shown before its description. Click any option in the following table for information on the option.
Jview options
/cp
/cp:a
/cp:p
/v
/p
/d:

/cp

/cp classpath

Use the /cp option to set the CLASSPATH environment variable for the current compilation. Using this option specifies the path where the jvc or jview command-line tools can find system and user-defined classes. The Java interpreter uses a platform-dependent default location and the CLASSPATH environment variable to find system classes. See CLASSPATH Environment Variable for more information. The directories in the class path are separated by semicolons on a Microsoft® Windows® system; by colons on UNIX.

Example:

For example, on Windows NT®, the class path might be:

jview /cp x:.;x:\java\classes

In this example, jview searches in and beneath the directories on the path for system and user-defined classes.


/cp:a

/cp:a path

Appends the path entered to the end of the CLASSPATH environment variable and inserts a semicolon between them.

For a full description of the CLASSPATH environment variable, see CLASSPATH Environment Variable.

Note The value for the class path can come from the CLASSPATH environment variable or from the /cp option. When multiple /cp:a switches are entered, the paths are concatenated.

Example:

The following command concatenates the directories, myproj1 and myproj2, and appends the resulting path to the end of the existing class path.

jview /cp:a myproj1 /cp:a myproj2

/cp:p

/cp:p path

This option is inserted before the path entered to the CLASSPATH and inserts a semicolon between them. When multiple /cp:p switches are entered, the paths are concatenated.

Note The value for the class path can come from the CLASSPATH environment variable or from the /cp option. See CLASSPATH Environment Variable for more information.

Example:

The following command concatenates the directories, myproj1 and myproj2, and is inserted before the resulting path to the existing class path.

jview /cp:p myproj1/cp:p myproj2

/v

/v

Use the /v option to cause jview to verify all invoked methods. Without this option, only methods from untrusted loaders are verified. Verification is a process applied to the byte code loaded from the class files to ensure that it does not pose a security threat. For remotely loaded class files, the Microsoft Win32 VM for Java (Microsoft VM) allows only a subset of the total functionality possible with the byte code language. Verification enforces this so that if your class files attempt to do anything illegal, the class file is rejected.

For performance reasons, local system classes are not normally verified. The /v option forces the verifier to process these. You can use this to ensure that a set of class files will pass the verifier.


/p

/p

Use the /p option to force jview to pause before exiting if an error occurs. You can use this to determine the user interface state just prior to the error when debugging an application.


/d:

/d:property=string value

Use the /d: option to set a system property. System properties can be read using the Java.lang.System.getProperty or Java.lang.System.getProperties methods. See these methods for descriptions of system properties. As an example, you can use the following command line to set the user.dir property to some arbitrary value:


jview /d:user.dir=c:\java\test  myapp 

You can also set user-defined properties. For example, you can set a property called "myprop" with the following command-line


jview /d:myprop=12   myapp 


Top© 1997 Microsoft Corporation. All rights reserved. Legal Notices.