JDK command details

Source: Internet
Author: User

Source: java Community Author: Anonymous

Rmic

Function Description:
Rmic generates stub and skeleton for remote objects.

Syntax:
Rmic [options] package-qualified-class-name (s)

Additional instructions:
The rmic compiler generates stub and skeleton for Remote objects based on the compiled Java class (including Remote object implementation) name (Remote objects refer to objects that implement java. rmi. Remote interfaces ). The class given in the rmic command must be a class successfully compiled by the javac command and fully qualified.

Command Options
-Classpath [path] specifies the path of the rmic used to query the class. If this option is set, it overwrites the default value or CLASSPATH environment variable. Directories are separated by colons.

-D [Directory] specifies the root directory of the class hierarchy. This option can be used to specify the target directories of stub and skeleton files.

-Depend: Enable the compiler to re-compile the class referenced from other classes. In general, it only recompiles the missing or expired classes referenced from the source code.

-G allows you to generate a debugging table. The debugging table contains information about the row number and local variables, that is, the information used by the Java debugging tool. By default, only the row number is generated.

-J is used with the-D option. It sends the option followed by the option (no space between-J and-D) to the java interpreter.

-Keepgenerated retains the generated. java source files for the stub and skeleton files and writes these source files to the same directory as the. class files. If you want to specify a directory, use the-d option.

-Nowarn: Close the warning. If this option is used, the compiler does not output any warning information.

-Show: displays the rmic compiler GUI (graphical user interface ). Enter one or more qualified class names (separated by spaces), and press the Enter key or the "show" button to create stub and skeleton.

-Vcompat (default) creates stub and skeleton compatible with JDK 1.1 and 1.2 stub.

-Verbose enables the compiler and the linker to output information about the classes being compiled and the class files being loaded.

-V1.1 create stub and skeleton of JDK 1.1 stub.

-V1.2 only creates stub of JDK 1.2 stub Protocol version.

Rmid

Function Description:
Rmid starts the activation system daemon to register and activate objects on the Java Virtual Machine.

Syntax:
Rmid [-port] [-log dir]

Additional instructions:
Run the rmid tool to activate the system daemon. You must first start the activation system daemon to register an activated object with the activation system or activate an activated object on the Java Virtual Machine.

Command Options
-C <some command line options> specifies an option. When creating a sub-daemon (activation group) for each rmid, this option is passed to the sub-daemon as a command line parameter.

-Log [Directory] specifies the directory name to activate the system daemon to write its database and related information to the directory. By default, a log directory is created in the directory where the rmid command is executed.

-Port [port] specifies the port used by the Registration Service Program of rmid. The activation system daemon binds ActivationSystem with the name java. rmi. activation. ActivationSystem in the registration service.

-Stop: Call the current rmid on the port specified by the stop-port option. If no port is specified, the rmid running on port 1098 is stopped.

Rmiregistry

Function Description:
The rmiregistry command can start the Remote Object Registration Service Program on the specified port of the current host.

Syntax:
Rmiregistry [port]

Additional instructions:
The rmiregistry command creates and starts the Remote Object Registration Service Program on the specified port of the current host. If port is omitted, the registration service starts on port 1099. The rmiregistry command does not generate any output and is generally run in the background. The Remote Object Registration Service Program is a UDF Naming Service. The RMI server on the host will use it to bind the remote object to the name. The client can query remote objects and call remote methods. Registering a service program is generally used to locate the first remote object that an application needs to call its method. This object, in turn, provides corresponding support for each application to find other objects.

The java. rmi. registry. LocateRegistry class method can be used to obtain registration service program operations on a host, host, or port. Java. rmi. the URL-based method of the Naming class will operate the registration service program, and can be used to query remote objects, simple (string) bind the name to a remote object, bind the new name to the remote object (overwrite the old binding), unbind the remote object, and list the URLs bound to the registered service program.

Serialver

Function Description:
The serialver command returns the serialVersionUID.

Syntax:
Serialver [Command Options]

Additional instructions:
Serialver returns the serialVersionUID of one or more classes in the form suitable for copying to the evolutionary class. When a parameter is not called, It outputs the usage line.

Command Options
-Show shows a simple user interface. Enter the complete Class Name and press the Enter key or the "show" button to display the serialVersionUID.

Jarsigner

Function Description:
Generate a signature for the Java archive (JAR) file and verify the signature of the signed JAR file.

Syntax:
Jarsigner [Command Options] jar-file alias
Jarsigner-verify [Command Option] jar-file

Additional instructions:
The jarsigner tool is used for two purposes:
1: sign the Java archive (JAR) File
2: Verify the signature and integrity of signed JAR files

Command Options
-Keystore [url] specifies the URL of the key repository. The default value is the. keystore file in your home directory, which is determined by the system property "user. home.

-Storetype [storetype] specifies the key repository type to be instantiated. The default key repository type is the type specified by the "keystore. type" attribute value in the security Attribute file, which is returned by the static method getDefaultType in java. security. KeyStore.

-Storepass [password] specifies the password required to access the key repository. This is only required when signing (not verifying) JAR files. In this case, if the-storepass option is not provided in the command line, the user will be prompted to enter the password.

-Keypass [password] specifies the password used to protect the private key of the key warehouse item (marked by the alias specified in the command line. This password is required when jarsigner is used to sign the JAR file. If the command line does not provide a password, and the required password is different from the key warehouse password, the user is prompted to enter it.

-Sigfile: Specify the basic file names used to generate. SF and. DSA files.

-Signedjar: Specifies the name of the signed JAR file.

-Verify: If it appears in the command line, the specified JAR file will be verified instead of the signature. If the verification is successful, "jar verified" is displayed ". If you try to verify unsigned JAR files or verify the JAR files signed by unsupported algorithms (such as RSA used when the RSA provider is not installed), the following information is displayed: "jar is unsigned. (signatures missing or not parsable )".

-If certs appears in the command line with the-verify and-verbose options, the output will include the certificate information of each signatory in the JAR file.

-If verbose appears in the command line, it represents the "verbose" mode, which enables jarsigner to output additional information during the JAR signature or verification process.

-Internalsf in the past, the. DSA (signature block) file generated when the JAR file is signed contains a complete encoded copy of The. SF file (signature file) generated at the same time. This method has been changed. To reduce the overall size of the output JAR file, by default,. DSA files no longer contain copies of. SF files. However, if-internalsf appears in the command line, the old practice will be adopted. This option is mainly useful during testing; it should not be used in fact because it will eliminate useful optimizations.

-Sectionsonly if it appears in the command line, the. SF file (signature file) generated when the JAR file is signed does not include the hash header containing the entire list file. It only contains information and hashes related to each separate source file in JAR. This option is mainly useful during testing; it should not be used in fact because it will eliminate useful optimizations.

-J [javaoption] directly transmits the specified javaoption string to the Java interpreter. (Jarsigner is actually a "wrapper" of the interpreter "). This option should not contain any spaces. It helps adjust the execution environment or memory usage. To obtain a list of available interpreter options, type java-h or java-X in the command line.

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]

Additional instructions:
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]

Additional instructions:
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...

Additional instructions:
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

Additional instructions:
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]

Additional instructions:
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 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 an overview file from the source file specified by path/filename, and include the overview file in 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

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.