JDK command details (2)-General Linux technology-Linux programming and kernel information. The following is a detailed description. Keytool
Function Description:
Manage a key warehouse (database) consisting of a private key and an X.509 Certificate Chain of the relevant public key ). You can also manage certificates from trusted entities.
Syntax:
Keytool [command]
Note:
Keytool is a key and certificate management tool. It enables users to manage their own public/private key pairs and related certificates for (digital signature) Self-authentication (users authenticate themselves to other users/services) or data integrity and authentication services. It also allows users to store the public keys of their communication peers (in the form of certificates ).
Native2ascii
Function Description:
Convert a file that contains both local and non-Unicode characters to a Unicode character.
Syntax:
Native2ascii [options] [inputfile [outputfile]
Note:
The Java compiler and other Java tools can only process files containing Latin-1 and/or Unicode (udddd mark) characters. Native2ascii converts a file containing other character encoding into a file containing Latin-1 and/or Unicode encoding characters. If outputfile is omitted, the standard output device is used. In addition, if inputfile is also omitted, standard input is used for device input.
Command Options
-Reverse: convert a file containing Latin-1 and/or Unicode characters to a file containing local encoding characters.
-Encoding [encoding_name] specifies the encoding name used in the conversion process. The default encoding is obtained from the system property file. encoding.
Appletviewer
Function Description:
Java applet browser. The appletviewer command can run the applet without the web browser environment.
Syntax:
Appletviewer [threads flag] [Command Option] urls...
Note:
The appletviewer command connects to the document or resource to which the url points, and displays each applet referenced by the document in its own window. Note: If the document to which the url points does not reference any APPLET with the OBJECT, EMBED, or applet tag, appletviewer will not do anything.
Command Options
-Debug starts appletviewer in the Java debugger jdb so that you can debug the applet in the document.
-Encoding [encoding name] specifies the encoding name of the input HTML file.
-J [javaoption] transmits the javaoption string as a single parameter to the Java interpreter running appletviewer. The parameter cannot contain spaces. A string composed of multiple parameters. Each parameter must start with-J and be removed after the prefix. This will be useful when adjusting the compiler's execution environment or memory usage.
Extcheck
Function Description:
Extcheck checks the version conflict between the target jar file and the extension jar file of the current installation method.
Syntax:
Extcheck [-verbose] targetfile. jar
Note:
The extcheck utility checks whether the title and version of the specified Jar file conflict with the extension installed in the jdk tm software. Before installing an extension, you can use this utility to check whether the extension has the same or higher version.
The extcheck utility sets targetfile. the specification-title and specification-version headers of the jar file list compare with the corresponding headers of all Jar files currently installed in the extension directory (the default extension directory is jre/lib/ext). The extcheck utility Compares version numbers in the same way as java. lang. Package. isCompatibleWith. If no conflict is detected, the returned code is 0. If the list of any jar file in the extension directory has the same specification-title and the same or updated specification-version number, a non-zero error code is returned. If the list of targetfile. jar does not contain the specification-title or specification-version attribute, a non-zero error code is returned.
Command Options
-Verbose checks the Jar files in the extended directory to list the files. In addition, the list attribute of the target jar file and all conflicting jar files are reported.
Jar
Function Description:
Java archiving Tool
Syntax:
Jar [Command Option] [manifest] destination input-file [input-files]
Note:
The jar tool is a java application that combines multiple files into a single JAR archive file. Jar is a versatile archive and compression Tool Based on ZIP and ZLIB compression formats. However, the main purpose of jar design is to easily package a java applet or application into a single archive file. Add the applet or application component (. when the class files, images, and sounds are merged into a single archive file, you can use a java proxy (such as a browser) to download them during an HTTP transaction process, instead of requiring a new connection for each component. This greatly shortens the download time. Jar can also compress files, further improving the download speed. In addition, it allows the author of the applet to sign each item in the file and authenticate its source. The syntax of the jar tool is basically the same as that of the tar command.
Command Options
-C create a new archive or empty archive on the standard output.
-T list the content table on the standard output.
-X [file] extracts all files from the standard input, or only the specified files. If file is omitted, all files are extracted; otherwise, only the specified files are extracted.
-F the second parameter specifies the jar file to be processed. In the case of-c (creation), the second parameter refers to the name of the jar file to be created (not on the standard output ). In the case of-t (Table (or-x (extraction), the second parameter specifies the jar file to be listed or extracted.
-V outputs a growth format on a standard error output device.
-M includes the configuration information in the specified existing inventory file. Example: "jar cmf myManifestFile myJarFile *. class"
-0 stores only, without ZIP compression.
-M does not create a project inventory file.
-U updates an existing JAR file by adding a file or changing the list. Example: "jar-uf foo. jar foo. class "to file foo. add class to the existing JAR file foo. jar, while "jar umf manifest foo. jar, use the information in manifest to update foo. jar list.
-C: Change the directory during jar command execution. For example, "jar-uf foo. jar-C classes *" adds all files in the classes directory to foo. jar, but does not add the class directory itself.
Program example
1: package all the CLASS files in the current directory into new JAR files:
Jar cf file. jar *. class
2: display the file list in a JAR file
Jar tf file. jar
3: add all files in the current directory to an existing JAR file.
Jar cvf file. jar *
Javadoc
Function Description
The Java API document builder generates an API document HTML page from the Java source file.
Syntax:
Javadoc [Command Options] [package name] [source file name] [@ files]
The [package name] is the name of a series of packages separated by spaces. The package name cannot use wildcards, such (*). The [source file name] is a series of source file names separated by spaces. The source file name can contain paths and wildcards, such (*). [@ Files] contains one or more files of the package name and source file in any order.
Additional instructions
Javadoc parses the declarations and document comments in the Java source file and generates corresponding HTML page defaults), describes public classes, protection classes, internal classes, interfaces, constructors, methods, and domains.
In implementation, Javadoc requires and relies on the java compiler to complete its work. Javadoc calls some javac compilation declarations and ignores member implementations. It establishes a rich internal representation of the class content, including the class hierarchy and the "use" relationship, and then generates HTML from it. Javadoc also obtains user-provided documents from the source code documentation annotations.
When Javadoc establishes its internal document structure, it loads all referenced classes. Because of this, Javadoc must be able to find all referenced classes, including the bootstrap class, extension class, and user class.
Command Options
-Overview I> path/filename specifies that javadoc should obtain the overview document from the "Source" file specified by path/filename and put it on the overview page (overview-summary.html ). Path/filename is the relative path name relative to-sourcepath.
-Public: Only public classes and members are displayed.
-Protected only displays protected and public classes and members. This is the default status.
-Package only displays packages, protected and public classes, and members.
-Private: displays all classes and members.
-Help: displays online help, which lists these javadoc and doclet command line options.
-Doclet class specifies to start the docle class file used to generate the document. The doclet defines the output content and format. If the-doclet option is not used, javadoc uses the standard doclet to generate the default HTML format. This class must contain the start (Root) method. The path of the startup class is defined by the-docletpath option.
-Docletpath classpathlist specifies the path of the doclet class file, which is specified using the-doclet option. If doclet is already in the search path, you do not need to use this option.
-1.1 generate a document with the appearance and functions of the document generated with Javadoc 1.1. That is to say, the page background is gray, the image is used as the header, and the bullet list is used instead of the table. It has a single-layer destination directory structure and does not contain the inherited API? * ** The TML framework does not support internal classes. This option also Automatically splits the index into one file per letter. If you want this appearance, this option is better than javadoc 1.1, which is equivalent to correcting some errors.
-Sourcepath sourcepathlist
When the package name is passed to the javadoc command, specify the search path to locate the source file (. java. Note that the sourcepath option can be used only when the javadoc command is used to specify the package name-it will not find the. java file passed to the javadoc command. If-sourcepath is omitted, javadoc uses the class path to find the source file.
-Classpath classpathlist specifies that javadoc will find the path of the reference class in it. The reference class refers to the class with documents plus any class they reference. Javadoc searches all subdirectories in the specified path. Classpathlist can contain multiple paths separated by commas.
-Bootclasspath classpathlist specifies the path of the Self-lifting class. They are nominal Java platform classes. This bootclasspath is part of the search path that Javadoc will use to find source files and class files. Use a colon (:) to separate directories in classpathlist.
-Extdirs dirlist specifies the directory where the extension class is located. They are any classes that use the Java extension mechanism. This extdirs is a part of the Javadoc that will be used to find the source file and the search path in the file. Separate directories with colons (:) In dirlist.
-Verbose provides more detailed information during javadoc operation. If the verbose option is not used, information about loading the source file, generating the file (one message for each source file), and sorting is displayed. The verbose option causes additional information to be printed, specifying the number of milliseconds to parse each java source file.
-Locale language_country_variant specifies the environment in which javadoc uses to generate documents.
-Encoding name specifies the source file encoding name, for example, EUCJIS/SJIS. If this option is not specified, the platform default converter is used.
-J [flag] directly transmits the flag to the runtime system java running javadoc. Note that no space is allowed between J and flag.
Standard Doclet options
-D directory specifies the target directory where javadoc saves the generated HTML file. If this option is omitted, the file will be saved to the current directory. Directory can be an absolute path or a relative path relative to the current working directory.
-Use includes a "usage" page for each document class and package. This page describes the packages, classes, methods, constructors, and domains that use any APIs of a given class or package. For a given class C, anything that uses Class C will include the subclass of class C, the domain declared as C, the method that returns C, and the methods and constructors with Class C parameters.
-Version includes the @ version text in the generated document. The text is omitted by default.
-Author includes the @ author text in the generated document.
-Splitindex divides the index file into multiple files by letter, each letter is a file, and a file containing all the index items starting with a non-letter character is added.
-Windowtitle [title]: HTML The title in the tag. It appears in the title bar of the window and any browser bookmarks (favorite location) created for the page. The title should not contain any HTML Tag, because the browser will not be able to correctly interpret them. Any internal quotation marks in the title must be escaped. If-windowtitle is omitted, Javadoc uses the-doctitle value for this option.
-Doctitle [title] specifies the title placed near the top of the overview file. The title will be used as the level-1 title and placed under the navigation bar in the center. Title can contain html tags and spaces, but if so, it must be enclosed in quotation marks. Any internal quotation marks in the title must be escaped.
-Title [title] This option no longer exists. It only exists in the Java SDK 1.2 Beta version. It has been renamed to-doctitle. Rename this option to make it clearer that it defines the document title rather than the window title.
-Header [header] specifies the header text placed on the top of each output file. The header is placed on the right of the upper navigation bar. The header can contain HTML tags and spaces, but if so, it must be enclosed by quotation marks. Any internal quotation marks in the header must be escaped.
-Footer [footer] specifies the footer text placed at the bottom of each output file. The script is placed on the right of the lower navigation bar. Footer can contain html tags and spaces, but if so, it must be enclosed in quotation marks. Any internal quotation marks in footer must be escaped.
-Bottom [text] specifies the text placed at the bottom of each output file. The text will be placed at the bottom of the page, under the lower navigation bar. Text can contain HTML tags and spaces, but if so, it must be enclosed in quotation marks. Any internal quotation marks in text must be escaped.
-Link [docURL]: creates a link to a document that has used the javadoc-generated external reference class. The docURL parameter is the URL of the javadoc-generated external document to be linked. This location can be a relative or absolute URL.
-Linkoffline [docURL] [packagelistURL] This option creates a link to the document for the external reference class name.
-Group [groupheading] packagepattern:... divides the package on the overview page into the specified group, each with a table. Use different-group options to specify each group. Each group appears on the page in the order specified in the command line. Packages in the group are sorted alphabetically. For the given-group option, the list of matched packagepattern expressions is displayed in the table titled groupheading.
-Nodeprecated prevents any APIs that are not encouraged in the document. It executes what nodeprecatedlist does and does not generate any APIs that are not encouraged in the rest of the document. This is useful when writing code that is not discouraged.
-Nodeprecatedlist prevents the generated file from containing the unsupported API catalog (deprecated-list.html) and links to the page from being contained in the navigation bar. (However, javadoc continues to generate APIs that are not encouraged in the rest of the document .) It is useful if the source code does not contain APIs that are not encouraged and you want to clean the navigation bar.
-Notree ignores class/interface layers in the generated document. This level is generated by default.
-Noindex: Ignore the index in the generated document. By default, indexes are generated.
-Nohelp ignores the "help" link in the navigation bar at the top and bottom of each output page.
-Nonavbar prevents navigation bar, header, and footer from being generated. Otherwise, they will appear at the top and bottom of the generated page. It has no effect on the "bottom" option. The-nonavbar option is useful when you are only interested in content and do not need to navigate. For example, you can convert a file to a PostScript or PDF file for printing.
-Helpfile [path/filename] specifies the path to replace the path/filename of the Help file linked to the "help" link in the top and bottom navigation bars. Without this option, Javadoc automatically creates the Help File help-doc.html, which is hard-coded in Javadoc. This option overwrites this default situation. Here filename can be any name, not limited to help-doc.html -- Javadoc will adjust the link in the navigation bar accordingly.
-Stylesheetfile [path/filename] specifies the path to replace the HTML style form file. If this option is not used, Javadoc automatically creates the style form file stylesheet.css, which is hard-coded in Javadoc. This option overwrites this default situation. Filename can be any name, not limited to stylesheet.css.
-Docencoding [name] specifies the encoding method of the output HTML file.
Javah
Function Description:
C header file and Stub file generator. Javah generates C header files and C source files from the Java class. These files provide connection gluing for Java and C code interaction.
Syntax:
Javah [Command Option] fully-qualified-classname...
Javah_g [Command Option] fully-qualified-classname...
Note:
Javah generates the C header file and source file required to implement the local method. C program uses the generated header file and source file to reference the instance variables of an object in the local source code .. The h file contains a struct definition. The layout of the definition is parallel to that of the corresponding class. The fields in the struct correspond to instance variables in the class.
Both the header file name and the structure name declared in the header file come from the class name. If the class passed to javah is in a package, the package name must be prefixed before the header file name and structure name. The underscore (_) is used as the name separator.
By default, javah creates a header file for each class listed in the command line and stores the file in the current directory. Use the-stubs option to create the source file. Use the-o option to concatenate the results of all listed classes into a single file.
By default, javah creates a header file for each class listed in the command line and stores the file in the current directory. Use the-stubs option to create the source file. Use the-o option to concatenate the results of all listed classes into a single file.
Command Options
-O [output file] concatenates header files or source files of all classes listed in the command line to the output file. -O or-d can only be selected.
-D [Directory] sets the directory where javah saves the header file or stub file. -D or-o options can only be selected.
-Stubs enables javah to generate a C declaration from a Java object file.
-Verbose indicates the output in long format and enables javah to output the status information of the generated file to the standard output device.
-Help outputs help information for javah usage.
-Version: output the version information of javah.
-Jni creates an output file for javah, which contains a JNI-style local method function prototype. This is the default output, so the use of-jni is optional.
-Classpath [path] specifies the path of the class to be queried by javah. If this option is set, it overwrites the default value or CLASSPATH environment variable. Directories are separated by colons.
-Bootclasspath [path] specifies the path used to load the UDF class. By default, the UDF class is the class that implements the core Java platform, which is located in jrelib
T. jar and jrelibi18n. jar.
-Old specifies that header files of the old JDK style should be generated.
-Force indicates that the output file is always written.
Javap
Function Description:
Java file parser.
Syntax:
Javap [Command Option] class...
Note:
The javap command is used to parse class files. The output depends on the options used. If no option is used, javap will output the public domain and method of the class passed to it. Javap outputs it to the standard output device.
Command Options
-Help outputs help information for javap.
-L output rows and local variable tables.
-B ensures backward compatibility with JDK 1.1 javap.
-Public: Only public classes and members are displayed.
-Protected: only the protected and public classes and members are displayed.
-The package only displays the package, protected, and public classes and members. This is the default setting.
-Private: displays all classes and members.
-J [flag] directly transmits the flag to the runtime system.
-S output internal type signature.
-C: the unparsed code of each method in the output class, that is, the instruction that constitutes the Java bytecode.
-Verbose outputs the stack size, locals, and args of each method.
-Classpath [path] specifies the javap used to find the class path. If this option is set, it overwrites the default value or the CLASSPATH environment variable. Directories are separated by colons.
-Bootclasspath [path] specifies the path used to load the UDF class. By default, the UDF class is the class that implements the core Java platform, which is located in jrelib
T. jar and jrelibi18n. jar.
-Extdirs [dirs] overwrites the location where the installation method is extended. The default extension location is jrelibext.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.