Tools Quick Reference |
![]() Previous |
![]() About Tools |
![]() Index |
![]() Next |
This section defines the command line syntax and operation of the Java tools.
appletviewer url | filename
Runs a Java applet.
Parameter Description url Specifies the address of an HTML file containing an APPLET tag that defines the Java applet to run. filename Names the HTML file containing an APPLET tag that defines the Java applet to run.
msjavah [options] ClassName
Generates C language header files for Java classes.
Parameter Description options Can be a combination of the following:
/v Verbose output. /classpath pathname Sets an alternate class path to search in addition to the CLASSPATH environment variable. /d output directory Specifies an output directory to place the header files. Ignored if the file name used with the /o option includes absolute path names. /o outfile Specifies the output file name of the header file. By default, a separate header name is generated for each class name based on the class name. With this option specified, all classes are generated in the header file specified by outfile. /nologo Suppresses the copyright message. ClassName Name of the Java class for which to create a C header file (required). Remarks:
Unlike other tools, you must give a Java class reference instead of a file name for the given class, as in the following example.
msjavah java.lang.ThreadOne command can create multiple headers, and a header file will be created for each (unless the /o option is included). For example, the following command produces two header files, java_util_Hashtable.h and java_lang_System.h.
msjavah java.util.Hashtable java.lang.SystemIn contrast, this command generates a file called headers.h, which includes both classes:
msjavah /o headers.h java.util.Hashtable java.lang.System
ClassVue [options] [drive:][path] ClassFilename [>outputfile]
Displays the contents of a Java class in a readable format.
Parameter Description options Can be a combination of the following:
/min Displays only D1 level information. /ltd Displays only D1, D2, and D3 level information (see below for definition). /v Verbose display of .class file. /cpno Suppresses display of constant pooling. /tables Displays many of the items in table form. /ivmal Generates informal Virtual Machine Assembly Language. /CVue Displays output sent to a file named by the package and class with the extension .cvue. /q Quiet mode; suppresses copyright banner. /? Displays the list of available options. /D? Displays the list of information levels. /README Displays descriptions of Microsoft® ActiveX™ terms and abbreviations displayed by ClassVue, and known issues relating to the tool. ClassFilename Name of a Java .class file. This must specify a drive and/or a path of the file if it is not in the current drive or directory. Remarks:
The ClassVue tool writes information to the standard output, listing a class overview, and the offsets, sizes, types, and values of the constant pool, fields, methods, and attributes belonging to the class.
The ClassVue tool generates seven description levels. By default, all levels are displayed. You can use the /min, /ltd or /cpno options to alter the levels displayed. The description levels are as follows:
D1 Overview information D2 Methods, fields, and classes D3 Root data structures D4 Constant pool D5 Fields pool D6 Methods pool D7 Attributes pool Example:
The following command generates information about a class named "Hello".
classvue \SDK\Samples\Jexegen\Hello\Test\Hello.class
Generates a globally unique identifier (GUID).
Remarks:
The guidgen displays a dialog box with which you specify the format of the GUID definition. You can then save the definition to the Clipboard and paste it into your source file. For more information on using this tool, press F1 in the guidgen dialog box to open a Help window.
jexegen [options] files
Converts Java classes into a fully executable Win32 application.
Parameter Description options Can be a combination of the following:
/MAIN:classname Sets the name of the main .class file. This option is required. /NOMAIN No main .class file is specified (useful only in conjunction with /RAW or /BINDTO options). /BASE:dir Changes the base directory used when determining package names of specified .class files to dir. /OUT: filename Sets output file name. /R[–] Recurses into subdirectories when searching for the specified .class files. Use a dash (–) after the switch to disable this option if /R has already been used in the command string. /V Provides detailed output. /W The generated executable will not have an associated console window. /BINDTO: stub Specifies the stub (.exe or .dll file) to bind the class resources to. /RAW Saves resource data to a file and does not generate an executable. files Name of the Java .class file(s) from which the executable will be generated. See Reference to Jexegen Command-Line Options for a detailed description of each of these options.
Remarks:
If you do not specify the /OUT option, the tool creates the executable file Jex.exe by default.
Examples:
The following command creates the executable file, Hello.exe, from a single .class file, Hello.class.
jexegen /OUT:hello.exe /MAIN:Hello Hello.classThe following command creates the executable file, ClassVue.exe, from all classes in the SDK for Java's ClassVue directory.
jexegen /OUT:classvue.exe /MAIN:ClassVue *.class
jvc [options] filename
Creates Java programs and applets by compiling Java source code.
Parameter Description options Can be a combination of the following:
/cp classpath Set the CLASSPATH environment variable for the current compilation. /cp:o Prints the class path to standard output. /cp:p path Inserts the path entered, and a semicolon, to the beginning of the CLASSPATH environment variable. /d Specifies an output directory other than the current directory for the .class files. /g [–] Generates all debugging information. Use a dash (–) after the switch to disable this option. /g:l [–] Generates line number debugging information. Use a dash (–) after the switch to disable this option. /g:t [–] Generates debug tables. Use a dash (–) after the switch to disable this option. /nowrite Compiles a .java file and suppresses the writing of a .class file. /O [–] Combines optimizing options to produce the fastest possible program. Use a dash (–) after the switch to disable this option. /O:I [–] Optimizes compilation by inlining methods when appropriate. Use a dash (–) after the switch to disable this option. /O:J [–] Optimizes bytecode jumps (default setting). Use a dash (–) after the switch to disable this option. /verbose Prints messages about compilation progress. /w[0–4] Sets warning level (default is 2). /x [–] Disables extensions (default is to enable extensions). See Reference to Jvc Command-Line Options for a detailed description of each of these options.
filename Name of one or more source files. Remarks:
You can specify any number of options and file names, as long as the number of characters on the command line does not exceed 1024 or the limit dictated by the operating system.
See JVC Errors and Warning Messages for a listing of all errors and warnings produced by this compiler.
jcom [options] files
Generates Java source from type libraries.
Parameter Description options Can be a combination of the following:
/b Follow JavaBeans design pattern for properties. /cj Create template for implementing coclass in Java. /d directory Set output directory (default=%WINDIR%\java\trustlib). /e Exclude output for typelibs not on command line. /G3.1 Target 3.1 Microsoft VM for Java (default=/G4). /G4 Target 4.0 Microsoft VM for Java (default=/G4) /j Generates undecorated Java source. /l lstfile Create list of all output files (default=none). /n jnffile specify JNF file (default=none). /nologo Don't show logo. /p pname Set root package (default=none). /p:b- Don't include typelib name in package. /r Register type libraries. /w Disable all warnings. /WX Treat warnings as errors. /x2 Represent 2-byte integers as 'char'. /xc Ignore coclasses in typelib. /xd- Do not generate *Default interfaces. /xh Do not map S_FALSE to ComSuccessException. /X:m- Disable automarshal (default=automarshal). /xi Expose default interface methods directly on coclass. /? Display help. files Name of the type library from which the Java source will be generated. For more information on jcom command-line options, see Jcom command-line options.
Remarks:
Warning Do not use Microsoft Visual J++ compilers prior to version 1.02.3920 to compile the files generated by this tool.
jview [options] classname [arguments]
Executes Java applications from the command line.
Parameter Description options Can be a combination of the following:
/cp classpath Set the CLASSPATH environment variable. See CLASSPATH Environment Variable for more information. /cp:a path Appends the path entered to the end of the CLASSPATH environment variable and inserts a semicolon between them. /cp:p path Inserts the path entered, and a semicolon, at the beginning of the CLASSPATH environment variable. See Reference to Jview Command-Line Options for more information.
/p Pauses before terminating if an error occurs. /v Verify all invoked methods (normally only methods from untrusted loaders are verified). /D:property=value Sets a system property to a specified value. System properties are defined in the Java.lang.system.getProperty method. classname Name of the .class file to execute. Do not include the .class extension to this file name. arguments Command-line arguments to be passed to the .class file supplied in classname. Remarks:
This tool can be used only to view Java applications (which include a main method). Use a Java-enabled browser to view Java applets.
qvue [options] classname
Prints out class method signatures and identifies .class files that were generated from a type library.
Parameter Description options Can be used with:
/s Only print the type of class (whether a Java class or a class generated from a type library). Does not print the class methods. classname Name of the .class file to inspect. Qvue supports wildcards. Remarks:
The qvue tool is similar to the /U option on JavaTLB, which printed out class file summaries. This tool is convenient for selecting the correct classfile to use when the classfiles are generated from a type library using jcom.
wjview [options] classname [arguments]
Executes Java applications from the command line and spawns a separate window process.
Parameter Description options Can be a combination of the following:
/cp classpath Set the CLASSPATH environment variable. See CLASSPATH Environment Variable for more information. /cp:a path Appends the path entered to the end of the CLASSPATH environment variable and inserts a semicolon between them. /cp:p path Inserts the path entered, and a semicolon, at the beginning of the CLASSPATH environment variable. /v Verifies all invoked methods (normally only methods from untrusted loaders are verified). classname Name of the .class file to execute. Do not include the .class extension to this file name. arguments Command-line arguments to be passed to the .class file supplied in classname. Remarks:
Use this tool to launch window-based Java applications (not applets). This tool is the same as the jview tool, with the exception that wjview runs the application as a separate graphical user interface (GUI) process and does not use or require a console window. Consequently, you should not use wjview for Java applications that require output to or input from the console window.
javareg [options]
Registers a Java class as implementing a COM interface.
Parameter Description /register Register the class parameter specified on the command line with specified class identifier in classid. You can also use /register with /class but without the class identifier to force JavaReg to create a CLSID and register it. /unregister Unregister the class specified in the class parameter. /class:classname Specifies the name (classname) to be registered with the specified classid or with the CLSID generated by JavaReg if no classid is specified . /classid:CLSID Specifies the class identifier (CLSID) to be registered with the specified class. Omit this parameter to force JavaReg to create a CLSID. /surrogate Support remote access to COM class. /progid Specifies a ProgID for the class being registered. /defappid Only meaningful when using the /surrogate option. By default, JavaReg uses the CLSID as the AppID. By specifying this option, JavaReg will use its own CLSID as the AppID. For more information on the AppID, see the Win32 Software Development Kit. /single Only meaningful when using the /surrogate option. This option causes a single instance of your class to be shared among multiple clients. Use this option if your object has no instance data, or if you want its instance data to be shared by all clients. /console Only meaningful when using the /surrogate option. Remarks:
See Using JavaReg more information about using this tool.
cabarc [options] command [files]
Handles the archiving of multiple files in a compressed format.
Parameter Description options The n command can take a combination of the following options:
-p Preserves the directory name in the cabinet file when used with the n command and uses that directory information when used with the x command. By default, only the filename component is stored or extracted. -P path Strips the path entered from any paths preserved in the cabinet file when using the p option. -r Archives files recursively in all subdirectories. -s size Reserves space size in the cabinet file for a code signature. The size parameter should be 6144 bytes. -i cabinet ID Includes a specified 16-bit cabinet identifier for application use. -m compression type Sets the compression type. compression type can be either MSZIP or NONE. MSZIP is used as the compression type by default. @file file Take the list of files to be added to the cabinet file from a specified text file. command Can be one of the following commands:
n filename Creates a new cabinet file with a name specified by filename. See the options above for a description of the options available with this command. l filename Lists the contents of the cabinet file specified by filename. Cabarc also displays any cabinet identifier in the cabinet file (see option -s above) and the following file information: size, date, time, and attributes. x Extracts files from the cabinet file specified by filename. See the -p option above for extracting files into the original directory. files Specifies a list of files to be archived. Wildcards (such as *.java) are accepted. All files are placed in a single folder, unless a plus sign (+) is placed in the list to delimit folders. For example the command "cabarc -n n mycab.cab test.* + *.java" would create two folders. Remarks:
Use this tool to create new cabinet files or to list or extract files from existing cabinet files.
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.