Tools Quick Reference |
![]() Previous |
![]() About Tools |
![]() Next |
This section defines the command line syntax and operation of the Java tools.
javatlb [options] {filename | @listfile}
Converts a type library into a Java language source file.
Parameter Description options Can be a combination of the following:
/d directory Specifies the root directory where javatlb will place the .class files it generates. /U classname Unassemble class file; displays the signatures for all the public methods in the .class file. /U:T Generates .class files and then writes the signature information to a text file. /p package Specifies the package name in which the class will be placed. /p:b[–] Include basename as package (on by default). Use a dash (–) after the switch to disable this option. /X:m[–] Automatically marshal COM parameters (on by default). Use a dash (–) after the switch to disable this option. filename Name of the type library (.tlb, .olb, .ocx, .dll, or .exe). listfile Name of a text file containing the names of one or more type library files. Remarks:
The packages and directories created by javatlb always have all-lowercase names.
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. /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.ThreadMultiple headers can be created with one command 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.SystemWhereas the 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 Display only D1 level information. /ltd Display only D1, D2, and D3 level information. /v Verbose display of .class file. /cpno Suppress display of constant pooling. /tables Display many of the items in table form. /ivmal Generate informal Virtual Machine Assembly Language. /CVue Display output sent to a file named by the package and class with the extension .cvue. /q Quiet mode; suppress 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.
There are seven description levels that are generated by the ClassVue tool. 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 Change the base directory used when determining package names of specified .class files to dir. /OUT: filename Sets output file name. /R[–] Recurse 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 ClassVue directory of the SDK:
jexegen /OUT:classvue.exe /MAIN:ClassVue *.class
jvc [options] filename
Creates Java programs and applets by compiling Java source code.
Parameter Description option Can be a combination of the following:
/cp classpath Set the CLASSPATH environment variable for the current compilation. /cp:o Print 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 Specify an output directory other than the current directory for the .class files. /g [–] Generate all debugging information. Use a dash (–) after the switch to disable this option. /g:l [–] Generate line number debugging information. Use a dash (–) after the switch to disable this option. /g:t [–] Generate debug tables. Use a dash (–) after the switch to disable this option. /nowrite Compile a .java file and suppresses the writing of a .class file. /O [–] Combine optimizing options to produce the fastest possible program. Use a dash (–) after the switch to disable this option. /O:I [–] Optimize by inlining methods when appropriate. Use a dash (–) after the switch to disable this option. /O:J [–] Optimize bytecode jumps (default setting). Use a dash (–) after the switch to disable this option. /verbose Print messages about compilation progress. /w[0–4] Set warning level (default is 2). /x [–] Disable 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.
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). 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.
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 Verify 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 tools 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, wjview should not be used for Java applications that require output to or input from the console window.