JDK Development Kit Java Development Kit is a Java software product of sun. He can easily develop and debug Java applications. The following describes how to use these tools: rmicFunction Description: Rmic generates stub and skeleton for remote objects. Syntax: Rmic [Options] package-qualified-class-name (s) Note: 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 port] [-log dir] Note: 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] Note: 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] Note: 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 Note: Jarsigner tool is used for two purposes: 1: signing a Java archive (jar) file 2: verifying the signature and integrity of the signed JAR File 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] 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 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 * 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 background of the page is gray. The page uses an image as the header and uses the bullet list instead of a table. It has a single-layer destination directory structure, does not contain the inherited API, and does not use the HTML framework, internal classes are not supported. 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 you pass the package name 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] specifies the title to be placed in the HTML <title> 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. |
|