JDK's command detailed _java programming

Source: Internet
Author: User
Tags bind documentation error code memory usage stub
Article Source: Java Community Author: anon

Rmic

function Description :
Rmic generates stubs and skeleton for remote objects.

Syntax :
rmic [Options] Package-qualified-class-name (s)

Supplementary Note :
The rmic compiler generates stubs and skeleton for remote objects based on the compiled Java class (which contains the remote object implementation) name (the remote object is the object that implements the Java.rmi.Remote interface). The class given in the rmic command must be a successfully compiled Javac command and a fully-qualified class.

Command Options
-classpath[Path] Specifies the path that Rmic uses to query the class. If this option is set, it overrides the default value or CLASSPATH environment variable. The directory is separated by a colon.


-d[Directory] Specifies the root directory of the class hierarchy. This option can be used to specify the target directory for stub and skeleton files.


-depend enables the compiler to consider recompiling a class that is referenced from another class. In general, it compiles only the missing or outdated classes that are referenced from the source code.

-G allows debugging tables to be generated. The Debug table contains information about line numbers and local variables, the information that is used by the Java debugging tools. By default, only row numbers are born.

-j with the-D option, which passes the immediately following option (no spaces between-j and-D) to the Java interpreter.

-keepgenerated preserves the generated. Java source files for stub and skeleton files, writes them to the same directory as the. class file, and uses the-D option if you want to specify a directory.

-nowarn shutdown warning. If you use this option, the compiler does not output any warning messages.

-show Displays the GUI for the Rmic compiler (graphical user interface). Enter one or more package-qualified class names (separated by spaces) and press Enter or the show button to create stubs and skeleton.

-vcompat (default) creates stubs and skeleton that are compatible with JDK 1.1 and 1.2 stub protocol versions.

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

-v1.1 creates the stub and skeleton of the JDK 1.1 stub protocol version.

-v1.2 only creates a stub for the JDK 1.2 stub protocol version.


Rmid

function Description :
Rmid initiates the activation of the system daemon so that objects can be registered and activated on the Java virtual machine.

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

Supplementary Note :
The Rmid tool initiates the activation of the system daemon. You must start the activation system daemon before you can register an active object to the activation system or activate an object that can be activated on the Java virtual machine.

Command Options
-c< Some command-line options > specifies an option to pass to the child daemon as a command-line parameter when creating a child daemon for each rmid (activating the group).

-log[Directory] Specifies the name of the directory that activates the system daemon to write its database and related information in that 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 Rmid registration service. Activating the system daemon binds the Activationsystem to the name Java.rmi.activation.ActivationSystem in the registration service program.

-stop stops the current Rmid call on the port specified by the-port option. If no port is specified, the Rmid running on port 1098 will be stopped.

Rmiregistry

function Description :
The rmiregistry command launches the remote object Registration service on the specified port of the current host.

Syntax :
Rmiregistry [Port]

Supplementary Note :
The Rmiregistry command creates and launches the remote object Registration service on the specified port of the current host. If Port is omitted, the registration service program will start on port 1099. The rmiregistry command does not produce any output and typically runs in the background. The remote object Registration service is a bootstrap naming service. The RMI server on the host will use it to bind the remote object to the name. The client can query the remote object and make a remote method call. The registration service program is typically used to locate the first remote object that the application needs to call its methods. This object, in turn, provides the appropriate support for each application to find other objects.

The Java.rmi.registry.LocateRegistry class method can be used to obtain a registry service operation on a host or host and port. The URL-based method of the Java.rmi.Naming class will operate on the registration service program and can be used to query remote objects, bind simple (string) names to remote objects, rebind new names to remote objects (overwrite old bindings), Cancels the binding of the remote object and lists the URLs that are bound on the registration service program.

Serialver

function Description :
The Serialver command returns SERIALVERSIONUID.

Syntax :
serialver [Command Options]

Supplementary Note :
Serialver returns the serialversionuid of one or more classes in a form suitable for copying to the Evolution class. When called without parameters, it outputs the usage line.

Command Options
The-show displays a simple user interface. Enter the full class name and press Enter or the show button to display the Serialversionuid.

Jarsigner

function Description :
Generates a signature for the Java archive (JAR) file and verifies the signature of the signed JAR file.

Syntax :
Jarsigner [command options] Jar-file alias
jarsigner-verify [command Options] Jar-file

Supplementary Note :
The Jarsigner tool is used for two purposes:
1: Sign a Java archive (JAR) file
2: Verify the signature and integrity of the signed JAR file

Command Options
-keystore[url] Specifies the URL of the key warehouse. The default value is the. keystore file in the user's host directory, which is determined by the system attribute "User.home".

-storetype[storetype] Specifies the key warehouse type to be instantiated. The default KeyStore type is the type specified by the value of the "Keystore.type" property in the Security property file, which is returned by the static method Getdefaulttype in Java.security.KeyStore.

-storepass[password] Specifies the password required to access the key warehouse. This is only required when signing (not validating) the JAR file. In this case, if the-storepass option is not available on the command line, the user is prompted for the password.

-keypass[password] Specifies the password used to protect the private key of the key warehouse entry, which is marked by the alias specified in the command line. This password is required to sign a JAR file using Jarsigner. 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[file] Specifies the for build. SF and. The base file name of the DSA file.

-signedjar[file] Specifies the name used for the signed JAR file.

-verify if it appears on the command line, the specified JAR file will be validated instead of signed. If the checksum succeeds, "Jar verified" is displayed. If you attempt to validate an unsigned jar file, or if you verify a JAR file that is signed by an unsupported algorithm, such as RSA, which is not installed with the RSA provider, you will see the following: "The jar is unsigned." (signatures missing or not parsable) ".

-certs if it appears on the command line with the-verify and-verbose options, the output will include the certificate information for each signer of the JAR file.

-verbose if it appears on the command line, it represents the "verbose" mode, which causes Jarsigner to output additional information during the JAR signature or validation process.

-INTERNALSF in the past, the JAR file was created when it was signed. The DSA (signature block) file contains a simultaneous generation. A fully encoded copy of the SF file (the signature file). This practice has been changed. To reduce the entire size of the output JAR file, by default. The DSA file is no longer included. A copy of the SF file. However, if-INTERNALSF appears on the command line, the old practice is used. This option is primarily useful for testing, and should not actually be used because it eliminates useful optimizations.

-sectionsonly if it appears on the command line, the JAR file is generated when it is signed. The SF file (the signature file) will not include a hash header that contains the entire manifest file. It contains only information and hashes related to each individual source file in the JAR. This option is primarily useful for testing, and should not actually be used because it eliminates useful optimizations.

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

Keytool

function Description :
Manages a key warehouse (database) of X.509 certificate chains consisting of private keys and authentication-related public keys. You also manage certificates from trusted entities.

Syntax :
Keytool [command]

Supplementary Note :
Keytool is a key and certificate management tool. It enables users to manage their own public/private key pairs and related certificates for (digitally signed) Self authentication (users authenticate themselves to other users/services) or data integrity and authentication services. It also allows users to store their communications counterparts ' public keys (in the form of certificates).

Native2ascii

function Description :
A file that converts files containing locally encoded characters (both Latin1 and non-Unicode characters) to Unicode encoded characters.

Syntax :
native2ascii [Options] [Inputfile [OutputFile]]

Supplementary Note :
The Java compiler and other Java tools can only handle files that contain Latin-1 and/or Unicode encoding (UDDDD notation) characters. Native2ascii converts files containing other character encodings into files containing Latin-1 and/or Unicode encoded characters. If OutputFile is omitted, the standard output device output is used. In addition, if Inputfile is omitted, the standard input device input is used.

Command Options
-reverse performs the opposite: converts files containing Latin-1 and/or Unicode encoded characters to files with locally encoded characters.

-encoding[encoding_name] Specifies the encoding name used by the conversion process. The default encoding is obtained from the system attribute file.encoding.

Appletviewer

function Description :
Java Applet Browser. The Appletviewer command can run applets without the World Wide Web browser environment.

Syntax :
Appletviewer [Threads flag] [command options] URLs ...

Supplementary 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 that the URL points to does not refer to any applets with an OBJECT, EMBED, or applet tag, then appletviewer does nothing.

Command Options
-debug starts appletviewer in the Java debugger jdb, allowing you to debug applets in your document.

-encoding[encoding Name] Specifies the encoding name of the input HTML file.

-j[javaoption] passes the javaoption string as a single parameter to the Java interpreter running Appletviewer. parameter cannot contain spaces. A string consisting of multiple parameters, each of which must begin with the prefix-j, which will be dropped later. This is useful when you are tuning the compiler's execution environment or memory usage.

Extcheck

function Description :
Extcheck detects the version conflict between the target jar file and the current installation mode extension jar file.

Syntax :
Extcheck [-verbose] Targetfile.jar

Supplementary Note :
The Extcheck utility checks to see if the title and version of the specified Jar file conflict with the extensions installed in the JDK TM software. Before you install an extension, you can use the utility to see if the same version or higher version of the extension is installed.

The Extcheck utility compares the Specification-title and specification-version headers of the Targetfile.jar file manifest with the corresponding headers currently installed in all jar files under the extended directory (the default extension directory is Jre/lib/ext). The Extcheck utility compares the version number in the same way as the Java.lang.Package.isCompatibleWith method. If no conflict is detected, the return code is 0. If the manifest for any jar file in the extended directory has the same specification-title and the same or updated specification-version number, a non 0 error code is returned. If there is no specification-title or specification-version attribute in the Targetfile.jar manifest, the same is true for a non 0 error code.

Command Options
-verbose files are listed when you check the Jar files in the extended directory. In addition, the manifest attributes of the target jar file and all conflicting jar files are reported.

Jar

function Description :
Java Archiving Tools

Syntax :
jar [command options] [manifest] Destination input-file [Input-files]

Supplementary Note :
The Jar tool is a Java application that can combine multiple files into a single jar archive. The jar is a multipurpose archive and compression tool, based on zip and zlib compression formats. However, the main purpose of designing jars is to facilitate the packaging of Java applets or applications into a single archive file. When you combine an applet or an application's components (. class files, images, and sounds) into a single archive, you can download them in an HTTP transaction with a Java proxy (such as a browser) instead of requiring a new connection for each component. This greatly shortens the download time. The jar can also compress files, which further increases the download speed. In addition, it allows the author of the applet to sign each item in the file, thereby authenticating its source. The syntax of the Jar tool is essentially the same as that of the tar command.

Command Options
-C Create a new archive or an empty archive on standard output.

-t lists the content table on standard output.

-x[file] Extracts all files from the standard input, or extracts only the specified files. If file is omitted, all files are extracted, otherwise only the specified file is extracted.

-F The second parameter specifies the jar file to process. In the-C (create) scenario, the second parameter refers to the name of the jar file to be created (not on the standard output). In-t (in the case of a table (or-X), the second parameter specifies the jar file to be listed or extracted.

-V The output of the growth format on the standard error output device.

-M includes the manifest information in the specified existing manifest file. Usage Example: "Jar CMF mymanifestfile myjarfile *.class"

-0 storage only, no ZIP compression.

-M does not create a manifest file for the project.

-U updates an existing JAR file by adding a file or changing the manifest. For example, "Jar-uf Foo.jar foo.class" adds a file Foo.class to an existing jar file Foo.jar, and "Jar UMF manifest Foo.jar" updates the manifest manifest with the information in Foo.jar.

-C Changes the directory during the execution of the jar command. For example, "Jar-uf foo.jar-c classes *" adds all the 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 the new jar file:
Jar CF File.jar *.class

2: Display a list of files in a jar file
Jar TF File.jar

3: Add all the 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 filename] [@files]
where [package name] is the name of a series of packets separated by a space, the package name does not allow wildcard characters, such as (*). [Source filename] is a series of source file names separated by a space, and the source file name can include the path and wildcard characters, such as (*). [@files] is one or more files that contain package names and source files in any order.

Supplementary Notes
javadoc resolves declarations and document annotations in Java source files and produces the corresponding HTML page defaults, describing public, protected, internal, interface, constructor, method, and domain.

When implemented, Javadoc requires and relies on the Java compiler to complete its work. Javadoc calls the partial Javac compilation Declarations section, ignoring member implementations. It establishes a rich internal representation of the class, including class hierarchies and "use" relationships, and then generates HTML from it. Javadoc also obtains the user-supplied documentation from the documentation comments for the source code.

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 boot classes, extended classes, and user classes.

Command Options
-overview i>path/filename Specifies that Javadoc should get an overview document from the source file specified by Path/filename and place it in the Overview page (overview-summary.html). Where Path/filename is the relative path name relative to the-sourcepath.

-public only displays public classes and members.

-protected only displays protected and common classes and members. This is the default state.

-package only displays packages, protected and common classes and members.

-private displays all classes and members.

-HELP Displays the online Help, which lists these Javadoc and Doclet command-line options.

The-doclet class specifies the class file that initiates the docle used to generate the document. The Doclet defines the content and format of the output. If the-doclet option is not used, Javadoc generates the default HTML format using standard Doclet. The class must contain the start (Root) method. The path to the startup class is defined by the-docletpath option.

-docletpath classpathlist Specifies the path to the Doclet class file, which is specified with the-doclet option. If Doclet is already in the search path, it is not necessary to use this option.

1.1 Generate a document with the appearance and functionality of the document generated with Javadoc 1.1. That is, the page has a gray background, a header with an image, a bullet list instead of a table, a Single-layer destination directory structure, no inheritance APIs, no tml framework, and no internal class support. This option also automatically splits the index into one file per letter. If you want this appearance, this option is superior to the Javadoc 1.1 equivalent of correcting some errors.

-sourcepath sourcepathlist
Specifies the search path to locate the source file (. java) when the package name is passed to the Javadoc command. Note You can use the SourcePath option only if you specify the package name with the Javadoc command-it will not find the. java file passed to the Javadoc command. If-sourcepath is omitted, Javadoc uses the classpath to find the source file.

-classpath classpathlist Specifies the path in which Javadoc will look for reference classes--reference classes refer to classes with documents plus any classes they reference. Javadoc will search for all subdirectories of the specified path. Classpathlist can include multiple paths, separated by commas.

-bootclasspath classpathlist Specifies the path where the bootstrap class resides. They are nominally Java platform classes. This bootclasspath is part of the search path that Javadoc will use to find the source files and class files. The directory is separated by a colon (:) in Classpathlist.

-extdirs dirlist Specifies the directory in which the extended class resides. They are any class that uses the Java extension mechanism. This extdirs is what Javadoc will use to find the source files and part of the search path in the file. The directory is separated by a colon (:) in Dirlist.

-verbose provides more detailed information when Javadoc is running. When you do not use the verbose option, information is displayed that loads the source file, generates the document (one piece of information for each source file), and sorts it. The verbose option causes additional information to be printed, specifying the number of milliseconds to resolve each Java source file.

-locale language_country_variant Specifies the environment that Javadoc uses when generating documents.

-encoding name Specifies the source file encoding name, such as Eucjis/sjis. If this option is not specified, the platform default converter is used.

-j[flag] passes the flag directly to the Run-time system Java running Javadoc. Note that there can be no spaces between J and flag.
The options provided by the standard Doclet

-D directory Specifies the destination directory for Javadoc to save the generated HTML pieces. Omitting this option will cause the file to be saved to the current directory. Where directory can be an absolute path or a relative path relative to the current working directory.

-use includes a usage page for each with a document class and package. This page describes the packages, classes, methods, constructors, and domains of any API that uses a given class or package. For a given class C, anything that uses Class C will include subclasses of C, Fields declared as C, methods that return C, and methods and constructors that have C-type parameters.

-version includes @version text in the build document. The text is omitted by default.

-author includes @author text in the build document.

-splitindex the index file into multiple files, one file for each letter, plus a file that contains all index entries that begin with a non-alphanumeric character.

-windowtitle[title] Specifies to put 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.