Jview Reference |
![]() Previous |
![]() About Tools |
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.
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. |
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.
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.
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.
/cp |
/cp:a |
/cp:p |
/v |
/p |
/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\classesIn this example jview searches in and beneath the directories on the path for system and user-defined classes.
/cp:a path
This option 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 may 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 classpath:
JVIEW /cp:a myproj1 /cp:a myproj2
/cp:p path
This option is inserted before the path entered to the class path and inserts a semicolon between them. When multiple /cp:p switches are entered, the paths are concatenated.
Note The value for the class path may 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
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 VM only allows 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 these be processed by the verifier. This can be used to ensure that a set of class files will pass the verifier.
/p
Use the /p option to force jview to pause before exiting if an error occurs. This can useful be for determining the user interface state just prior to the error when debugging an application.