提交 7f2b65ca 编写于 作者: R rgallard

8042009: Generate nroff for Java tools documentation for 8u20 release

Reviewed-by: mchung, kvn
上级 df13f28a
此差异已折叠。
此差异已折叠。
'\" t '\" t
.\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. .\" Copyright (c) 1994, 2014, Oracle and/or its affiliates. All rights reserved.
.\" .\"
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\" .\"
.\" This code is free software; you can redistribute it and/or modify it .\" This code is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License version 2 only, as .\" under the terms of the GNU General Public License version 2 only, as
.\" published by the Free Software Foundation. .\" published by the Free Software Foundation.
.\" .\"
.\" This code is distributed in the hope that it will be useful, but WITHOUT .\" This code is distributed in the hope that it will be useful, but WITHOUT
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
.\" version 2 for more details (a copy is included in the LICENSE file that .\" version 2 for more details (a copy is included in the LICENSE file that
.\" accompanied this code). .\" accompanied this code).
.\" .\"
.\" You should have received a copy of the GNU General Public License version .\" You should have received a copy of the GNU General Public License version
.\" 2 along with this work; if not, write to the Free Software Foundation, .\" 2 along with this work; if not, write to the Free Software Foundation,
.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
.\" .\"
.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Arch: generic .\" Title: javap
.\" Software: JDK 8 .\" Language: English
.\" Date: 21 November 2013 .\" Date: 8 August 2014
.\" SectDesc: Basic Tools .\" SectDesc: Basic Tools
.\" Title: javap.1 .\" Software: JDK 8
.\" Arch: generic
.\" Part Number: E38207-03
.\" .\"
.if n .pl 99999 .if n .pl 99999
.TH javap 1 "21 November 2013" "JDK 8" "Basic Tools" .TH "javap" "1" "8 August 2014" "JDK 8" "Basic Tools"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * Define some portability stuff .\" * Define some portability stuff
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673 .\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq .ie \n(.g .ds Aq \(aq
.el .ds Aq ' .el .ds Aq '
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" disable hyphenation .\" disable hyphenation
.nh .nh
.\" disable justification (adjust text to left margin only) .\" disable justification (adjust text to left margin only)
.ad l .ad l
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE * .\" * MAIN CONTENT STARTS HERE *
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.SH "NAME"
.SH NAME
javap \- Disassembles one or more class files\&. javap \- Disassembles one or more class files\&.
.SH SYNOPSIS .SH "SYNOPSIS"
.sp .sp
.nf .if n \{\
.RS 4
.\}
.nf
\fBjavap\fR [\fIoptions\fR] \fIclassfile\fR\&.\&.\&. \fBjavap\fR [\fIoptions\fR] \fIclassfile\fR\&.\&.\&.
.fi .fi
.sp .if n \{\
.TP .RE
.\}
.PP
\fIoptions\fR \fIoptions\fR
The command-line options\&. See Options\&. .RS 4
.TP The command\-line options\&. See Options\&.
.RE
.PP
\fIclassfile\fR \fIclassfile\fR
One or more classes separated by spaces to be processed for annotations such as DocFooter\&.class\&. You can specify a class that can be found in the class path, by its file name or with a URL such as \f3file:///home/user/myproject/src/DocFooter\&.class\fR\&. .RS 4
.SH DESCRIPTION One or more classes separated by spaces to be processed for annotations such as DocFooter\&.class\&. You can specify a class that can be found in the class path, by its file name or with a URL such as
The \f3javap\fR command disassembles one or more class files\&. The output depends on the options used\&. When no options are used, then the \f3javap\fR command prints the package, protected and public fields, and methods of the classes passed to it\&. The \f3javap\fR command prints its output to \f3stdout\fR\&. \fBfile:///home/user/myproject/src/DocFooter\&.class\fR\&.
.SH OPTIONS .RE
.TP .SH "DESCRIPTION"
-help, --help, -? .PP
The
\fBjavap\fR
command disassembles one or more class files\&. The output depends on the options used\&. When no options are used, then the
\fBjavap\fR
command prints the package, protected and public fields, and methods of the classes passed to it\&. The
\fBjavap\fR
command prints its output to
\fBstdout\fR\&.
.SH "OPTIONS"
.PP
\-help
.br .br
Prints a help message for the \f3javap\fR command\&. \-\-help
.TP
-version
.br .br
\-?
.RS 4
Prints a help message for the
\fBjavap\fR
command\&.
.RE
.PP
\-version
.RS 4
Prints release information\&. Prints release information\&.
.TP .RE
-l .PP
.br \-l
.RS 4
Prints line and local variable tables\&. Prints line and local variable tables\&.
.TP .RE
-public .PP
.br \-public
.RS 4
Shows only public classes and members\&. Shows only public classes and members\&.
.TP .RE
-protected .PP
.br \-protected
.RS 4
Shows only protected and public classes and members\&. Shows only protected and public classes and members\&.
.TP .RE
-private, -p .PP
\-private
.br .br
\-p
.RS 4
Shows all classes and members\&. Shows all classes and members\&.
.TP .RE
-J\fIoption\fR .PP
.br \-J\fIoption\fR
.RS 4
Passes the specified option to the JVM\&. For example: Passes the specified option to the JVM\&. For example:
.sp .sp
.nf .if n \{\
\f3javap \-J\-version\fP .RS 4
.fi .\}
.nf .nf
\f3javap \-J\-Djava\&.security\&.manager \-J\-Djava\&.security\&.policy=MyPolicy MyClassName\fP \fBjavap \-J\-version\fR
.fi \fBjavap \-J\-Djava\&.security\&.manager \-J\-Djava\&.security\&.policy=MyPolicy MyClassName\fR
.nf
\f3\fP .fi
.fi .if n \{\
.sp .RE
.\}
For more information about JVM options, see the command documentation\&.
For more information about JVM options, see the \f3java(1)\fR command documentation\&. .RE
.TP .PP
-s \-s
.br .RS 4
Prints internal type signatures\&. Prints internal type signatures\&.
.TP .RE
-sysinfo .PP
.br \-sysinfo
.RS 4
Shows system information (path, size, date, MD5 hash) of the class being processed\&. Shows system information (path, size, date, MD5 hash) of the class being processed\&.
.TP .RE
-constants .PP
.br \-constants
Shows \f3static final\fR constants\&. .RS 4
.TP Shows
-c \fBstatic final\fR
.br constants\&.
.RE
.PP
\-c
.RS 4
Prints disassembled code, for example, the instructions that comprise the Java bytecodes, for each of the methods in the class\&. Prints disassembled code, for example, the instructions that comprise the Java bytecodes, for each of the methods in the class\&.
.TP .RE
-verbose .PP
.br \-verbose
.RS 4
Prints stack size, number of locals and arguments for methods\&. Prints stack size, number of locals and arguments for methods\&.
.TP .RE
-classpath \fIpath\fR .PP
.br \-classpath \fIpath\fR
Specifies the path the \f3javap\fR command uses to look up classes\&. Overrides the default or the \f3CLASSPATH\fR environment variable when it is set\&. .RS 4
.TP Specifies the path the
-bootclasspath \fIpath\fR \fBjavap\fR
.br command uses to look up classes\&. Overrides the default or the
Specifies the path from which to load bootstrap classes\&. By default, the bootstrap classes are the classes that implement the core Java platform located in \f3jre/lib/rt\&.jar\fR and several other JAR files\&. \fBCLASSPATH\fR
.TP environment variable when it is set\&.
-extdir \fIdirs\fR .RE
.br .PP
Overrides the location at which installed extensions are searched for\&. The default location for extensions is the value of \f3java\&.ext\&.dirs\fR\&. \-bootclasspath \fIpath\fR
.SH EXAMPLE .RS 4
Compile the following \f3DocFooter\fR class: Specifies the path from which to load bootstrap classes\&. By default, the bootstrap classes are the classes that implement the core Java platform located in
.sp \fBjre/lib/rt\&.jar\fR
.nf and several other JAR files\&.
\f3import java\&.awt\&.*;\fP .RE
.fi .PP
.nf \-extdir \fIdirs\fR
\f3import java\&.applet\&.*;\fP .RS 4
.fi Overrides the location at which installed extensions are searched for\&. The default location for extensions is the value of
.nf \fBjava\&.ext\&.dirs\fR\&.
\f3\fP .RE
.fi .SH "EXAMPLE"
.nf .PP
\f3public class DocFooter extends Applet {\fP Compile the following
.fi \fBDocFooter\fR
.nf class:
\f3 String date;\fP .sp
.fi .if n \{\
.nf .RS 4
\f3 String email;\fP .\}
.fi .nf
.nf \fBimport java\&.awt\&.*;\fR
\f3\fP \fBimport java\&.applet\&.*;\fR
.fi \fB \fR
.nf \fBpublic class DocFooter extends Applet {\fR
\f3 public void init() {\fP \fB String date;\fR
.fi \fB String email;\fR
.nf \fB \fR
\f3 resize(500,100);\fP \fB public void init() {\fR
.fi \fB resize(500,100);\fR
.nf \fB date = getParameter("LAST_UPDATED");\fR
\f3 date = getParameter("LAST_UPDATED");\fP \fB email = getParameter("EMAIL");\fR
.fi \fB }\fR
.nf \fB \fR
\f3 email = getParameter("EMAIL");\fP \fB public void paint(Graphics g) {\fR
.fi \fB g\&.drawString(date + " by ",100, 15);\fR
.nf \fB g\&.drawString(email,290,15);\fR
\f3 }\fP \fB }\fR
.fi \fB}\fR
.nf
\f3\fP .fi
.fi .if n \{\
.nf .RE
\f3 public void paint(Graphics g) {\fP .\}
.fi .PP
.nf The output from the
\f3 g\&.drawString(date + " by ",100, 15);\fP \fBjavap DocFooter\&.class\fR
.fi command yields the following:
.nf .sp
\f3 g\&.drawString(email,290,15);\fP .if n \{\
.fi .RS 4
.nf .\}
\f3 }\fP .nf
.fi \fBCompiled from "DocFooter\&.java"\fR
.nf \fBpublic class DocFooter extends java\&.applet\&.Applet {\fR
\f3}\fP \fB java\&.lang\&.String date;\fR
.fi \fB java\&.lang\&.String email;\fR
.nf \fB public DocFooter();\fR
\f3\fP \fB public void init();\fR
.fi \fB public void paint(java\&.awt\&.Graphics);\fR
.sp \fB}\fR
The output from the \f3javap DocFooter\&.class\fR command yields the following:
.sp .fi
.nf .if n \{\
\f3Compiled from "DocFooter\&.java"\fP .RE
.fi .\}
.nf .PP
\f3public class DocFooter extends java\&.applet\&.Applet {\fP The output from
.fi \fBjavap \-c DocFooter\&.class\fR
.nf command yields the following:
\f3 java\&.lang\&.String date;\fP .sp
.fi .if n \{\
.nf .RS 4
\f3 java\&.lang\&.String email;\fP .\}
.fi .nf
.nf \fBCompiled from "DocFooter\&.java"\fR
\f3 public DocFooter();\fP \fBpublic class DocFooter extends java\&.applet\&.Applet {\fR
.fi \fB java\&.lang\&.String date;\fR
.nf \fB java\&.lang\&.String email;\fR
\f3 public void init();\fP
.fi \fB public DocFooter();\fR
.nf \fB Code:\fR
\f3 public void paint(java\&.awt\&.Graphics);\fP \fB 0: aload_0 \fR
.fi \fB 1: invokespecial #1 // Method\fR
.nf \fBjava/applet/Applet\&."<init>":()V\fR
\f3}\fP \fB 4: return \fR
.fi
.nf \fB public void init();\fR
\f3\fP \fB Code:\fR
.fi \fB 0: aload_0 \fR
.sp \fB 1: sipush 500\fR
The output from \f3javap -c DocFooter\&.class\fR command yields the following: \fB 4: bipush 100\fR
.sp \fB 6: invokevirtual #2 // Method resize:(II)V\fR
.nf \fB 9: aload_0 \fR
\f3Compiled from "DocFooter\&.java"\fP \fB 10: aload_0 \fR
.fi \fB 11: ldc #3 // String LAST_UPDATED\fR
.nf \fB 13: invokevirtual #4 // Method\fR
\f3public class DocFooter extends java\&.applet\&.Applet {\fP \fB getParameter:(Ljava/lang/String;)Ljava/lang/String;\fR
.fi \fB 16: putfield #5 // Field date:Ljava/lang/String;\fR
.nf \fB 19: aload_0 \fR
\f3 java\&.lang\&.String date;\fP \fB 20: aload_0 \fR
.fi \fB 21: ldc #6 // String EMAIL\fR
.nf \fB 23: invokevirtual #4 // Method\fR
\f3 java\&.lang\&.String email;\fP \fB getParameter:(Ljava/lang/String;)Ljava/lang/String;\fR
.fi \fB 26: putfield #7 // Field email:Ljava/lang/String;\fR
.nf \fB 29: return \fR
\f3\fP
.fi \fB public void paint(java\&.awt\&.Graphics);\fR
.nf \fB Code:\fR
\f3 public DocFooter();\fP \fB 0: aload_1 \fR
.fi \fB 1: new #8 // class java/lang/StringBuilder\fR
.nf \fB 4: dup \fR
\f3 Code:\fP \fB 5: invokespecial #9 // Method\fR
.fi \fB java/lang/StringBuilder\&."<init>":()V\fR
.nf \fB 8: aload_0 \fR
\f3 0: aload_0 \fP \fB 9: getfield #5 // Field date:Ljava/lang/String;\fR
.fi \fB 12: invokevirtual #10 // Method\fR
.nf \fB java/lang/StringBuilder\&.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\fR
\f3 1: invokespecial #1 // Method\fP \fB 15: ldc #11 // String by \fR
.fi \fB 17: invokevirtual #10 // Method\fR
.nf \fB java/lang/StringBuilder\&.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\fR
\f3java/applet/Applet\&."<init>":()V\fP \fB 20: invokevirtual #12 // Method\fR
.fi \fB java/lang/StringBuilder\&.toString:()Ljava/lang/String;\fR
.nf \fB 23: bipush 100\fR
\f3 4: return \fP \fB 25: bipush 15\fR
.fi \fB 27: invokevirtual #13 // Method\fR
.nf \fB java/awt/Graphics\&.drawString:(Ljava/lang/String;II)V\fR
\f3\fP \fB 30: aload_1 \fR
.fi \fB 31: aload_0 \fR
.nf \fB 32: getfield #7 // Field email:Ljava/lang/String;\fR
\f3 public void init();\fP \fB 35: sipush 290\fR
.fi \fB 38: bipush 15\fR
.nf \fB 40: invokevirtual #13 // Method\fR
\f3 Code:\fP \fBjava/awt/Graphics\&.drawString:(Ljava/lang/String;II)V\fR
.fi \fB 43: return \fR
.nf \fB}\fR
\f3 0: aload_0 \fP
.fi .fi
.nf .if n \{\
\f3 1: sipush 500\fP .RE
.fi .\}
.nf .SH "SEE ALSO"
\f3 4: bipush 100\fP .sp
.fi .RS 4
.nf .ie n \{\
\f3 6: invokevirtual #2 // Method resize:(II)V\fP \h'-04'\(bu\h'+03'\c
.fi .\}
.nf .el \{\
\f3 9: aload_0 \fP .sp -1
.fi .IP \(bu 2.3
.nf .\}
\f3 10: aload_0 \fP
.fi
.nf
\f3 11: ldc #3 // String LAST_UPDATED\fP
.fi
.nf
\f3 13: invokevirtual #4 // Method\fP
.fi
.nf
\f3 getParameter:(Ljava/lang/String;)Ljava/lang/String;\fP
.fi
.nf
\f3 16: putfield #5 // Field date:Ljava/lang/String;\fP
.fi
.nf
\f3 19: aload_0 \fP
.fi
.nf
\f3 20: aload_0 \fP
.fi
.nf
\f3 21: ldc #6 // String EMAIL\fP
.fi
.nf
\f3 23: invokevirtual #4 // Method\fP
.fi
.nf
\f3 getParameter:(Ljava/lang/String;)Ljava/lang/String;\fP
.fi
.nf
\f3 26: putfield #7 // Field email:Ljava/lang/String;\fP
.fi
.nf
\f3 29: return \fP
.fi
.nf
\f3\fP
.fi
.nf
\f3 public void paint(java\&.awt\&.Graphics);\fP
.fi
.nf
\f3 Code:\fP
.fi
.nf
\f3 0: aload_1 \fP
.fi
.nf
\f3 1: new #8 // class java/lang/StringBuilder\fP
.fi
.nf
\f3 4: dup \fP
.fi
.nf
\f3 5: invokespecial #9 // Method\fP
.fi
.nf
\f3 java/lang/StringBuilder\&."<init>":()V\fP
.fi
.nf
\f3 8: aload_0 \fP
.fi
.nf
\f3 9: getfield #5 // Field date:Ljava/lang/String;\fP
.fi
.nf
\f3 12: invokevirtual #10 // Method\fP
.fi
.nf
\f3 java/lang/StringBuilder\&.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\fP
.fi
.nf
\f3 15: ldc #11 // String by \fP
.fi
.nf
\f3 17: invokevirtual #10 // Method\fP
.fi
.nf
\f3 java/lang/StringBuilder\&.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\fP
.fi
.nf
\f3 20: invokevirtual #12 // Method\fP
.fi
.nf
\f3 java/lang/StringBuilder\&.toString:()Ljava/lang/String;\fP
.fi
.nf
\f3 23: bipush 100\fP
.fi
.nf
\f3 25: bipush 15\fP
.fi
.nf
\f3 27: invokevirtual #13 // Method\fP
.fi
.nf
\f3 java/awt/Graphics\&.drawString:(Ljava/lang/String;II)V\fP
.fi
.nf
\f3 30: aload_1 \fP
.fi
.nf
\f3 31: aload_0 \fP
.fi
.nf
\f3 32: getfield #7 // Field email:Ljava/lang/String;\fP
.fi
.nf
\f3 35: sipush 290\fP
.fi
.nf
\f3 38: bipush 15\fP
.fi
.nf
\f3 40: invokevirtual #13 // Method\fP
.fi
.nf
\f3java/awt/Graphics\&.drawString:(Ljava/lang/String;II)V\fP
.fi
.nf
\f3 43: return \fP
.fi
.nf
\f3}\fP
.fi
.nf
\f3\fP
.fi
.sp
.SH SEE\ ALSO
.TP 0.2i
\(bu
javac(1)
.TP 0.2i
\(bu
java(1) java(1)
.TP 0.2i .RE
\(bu .sp
jdb(1) .RS 4
.TP 0.2i .ie n \{\
\(bu \h'-04'\(bu\h'+03'\c
javah(1) .\}
.TP 0.2i .el \{\
\(bu .sp -1
.IP \(bu 2.3
.\}
javac(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
javadoc(1) javadoc(1)
.RE .RE
.br .sp
'pl 8.5i .RS 4
'bp .ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
javah(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
jdb(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
jdeps(1)
.RE
.br
'pl 8.5i
'bp
此差异已折叠。
此差异已折叠。
'\" t '\" t
.\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. .\" Copyright (c) 1994, 2014, Oracle and/or its affiliates. All rights reserved.
.\" .\"
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\" .\"
.\" This code is free software; you can redistribute it and/or modify it .\" This code is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License version 2 only, as .\" under the terms of the GNU General Public License version 2 only, as
.\" published by the Free Software Foundation. .\" published by the Free Software Foundation.
.\" .\"
.\" This code is distributed in the hope that it will be useful, but WITHOUT .\" This code is distributed in the hope that it will be useful, but WITHOUT
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
.\" version 2 for more details (a copy is included in the LICENSE file that .\" version 2 for more details (a copy is included in the LICENSE file that
.\" accompanied this code). .\" accompanied this code).
.\" .\"
.\" You should have received a copy of the GNU General Public License version .\" You should have received a copy of the GNU General Public License version
.\" 2 along with this work; if not, write to the Free Software Foundation, .\" 2 along with this work; if not, write to the Free Software Foundation,
.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
.\" .\"
.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Arch: generic .\" Title: javap
.\" Software: JDK 8 .\" Language: English
.\" Date: 21 November 2013 .\" Date: 8 August 2014
.\" SectDesc: Basic Tools .\" SectDesc: Basic Tools
.\" Title: javap.1 .\" Software: JDK 8
.\" Arch: generic
.\" Part Number: E38207-03
.\" .\"
.if n .pl 99999 .if n .pl 99999
.TH javap 1 "21 November 2013" "JDK 8" "Basic Tools" .TH "javap" "1" "8 August 2014" "JDK 8" "Basic Tools"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * Define some portability stuff .\" * Define some portability stuff
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673 .\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq .ie \n(.g .ds Aq \(aq
.el .ds Aq ' .el .ds Aq '
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" disable hyphenation .\" disable hyphenation
.nh .nh
.\" disable justification (adjust text to left margin only) .\" disable justification (adjust text to left margin only)
.ad l .ad l
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE * .\" * MAIN CONTENT STARTS HERE *
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.SH "NAME"
.SH NAME
javap \- Disassembles one or more class files\&. javap \- Disassembles one or more class files\&.
.SH SYNOPSIS .SH "SYNOPSIS"
.sp .sp
.nf .if n \{\
.RS 4
.\}
.nf
\fBjavap\fR [\fIoptions\fR] \fIclassfile\fR\&.\&.\&. \fBjavap\fR [\fIoptions\fR] \fIclassfile\fR\&.\&.\&.
.fi .fi
.sp .if n \{\
.TP .RE
.\}
.PP
\fIoptions\fR \fIoptions\fR
The command-line options\&. See Options\&. .RS 4
.TP The command\-line options\&. See Options\&.
.RE
.PP
\fIclassfile\fR \fIclassfile\fR
One or more classes separated by spaces to be processed for annotations such as DocFooter\&.class\&. You can specify a class that can be found in the class path, by its file name or with a URL such as \f3file:///home/user/myproject/src/DocFooter\&.class\fR\&. .RS 4
.SH DESCRIPTION One or more classes separated by spaces to be processed for annotations such as DocFooter\&.class\&. You can specify a class that can be found in the class path, by its file name or with a URL such as
The \f3javap\fR command disassembles one or more class files\&. The output depends on the options used\&. When no options are used, then the \f3javap\fR command prints the package, protected and public fields, and methods of the classes passed to it\&. The \f3javap\fR command prints its output to \f3stdout\fR\&. \fBfile:///home/user/myproject/src/DocFooter\&.class\fR\&.
.SH OPTIONS .RE
.TP .SH "DESCRIPTION"
-help, --help, -? .PP
The
\fBjavap\fR
command disassembles one or more class files\&. The output depends on the options used\&. When no options are used, then the
\fBjavap\fR
command prints the package, protected and public fields, and methods of the classes passed to it\&. The
\fBjavap\fR
command prints its output to
\fBstdout\fR\&.
.SH "OPTIONS"
.PP
\-help
.br .br
Prints a help message for the \f3javap\fR command\&. \-\-help
.TP
-version
.br .br
\-?
.RS 4
Prints a help message for the
\fBjavap\fR
command\&.
.RE
.PP
\-version
.RS 4
Prints release information\&. Prints release information\&.
.TP .RE
-l .PP
.br \-l
.RS 4
Prints line and local variable tables\&. Prints line and local variable tables\&.
.TP .RE
-public .PP
.br \-public
.RS 4
Shows only public classes and members\&. Shows only public classes and members\&.
.TP .RE
-protected .PP
.br \-protected
.RS 4
Shows only protected and public classes and members\&. Shows only protected and public classes and members\&.
.TP .RE
-private, -p .PP
\-private
.br .br
\-p
.RS 4
Shows all classes and members\&. Shows all classes and members\&.
.TP .RE
-J\fIoption\fR .PP
.br \-J\fIoption\fR
.RS 4
Passes the specified option to the JVM\&. For example: Passes the specified option to the JVM\&. For example:
.sp .sp
.nf .if n \{\
\f3javap \-J\-version\fP .RS 4
.fi .\}
.nf .nf
\f3javap \-J\-Djava\&.security\&.manager \-J\-Djava\&.security\&.policy=MyPolicy MyClassName\fP \fBjavap \-J\-version\fR
.fi \fBjavap \-J\-Djava\&.security\&.manager \-J\-Djava\&.security\&.policy=MyPolicy MyClassName\fR
.nf
\f3\fP .fi
.fi .if n \{\
.sp .RE
.\}
For more information about JVM options, see the command documentation\&.
For more information about JVM options, see the \f3java(1)\fR command documentation\&. .RE
.TP .PP
-s \-s
.br .RS 4
Prints internal type signatures\&. Prints internal type signatures\&.
.TP .RE
-sysinfo .PP
.br \-sysinfo
.RS 4
Shows system information (path, size, date, MD5 hash) of the class being processed\&. Shows system information (path, size, date, MD5 hash) of the class being processed\&.
.TP .RE
-constants .PP
.br \-constants
Shows \f3static final\fR constants\&. .RS 4
.TP Shows
-c \fBstatic final\fR
.br constants\&.
.RE
.PP
\-c
.RS 4
Prints disassembled code, for example, the instructions that comprise the Java bytecodes, for each of the methods in the class\&. Prints disassembled code, for example, the instructions that comprise the Java bytecodes, for each of the methods in the class\&.
.TP .RE
-verbose .PP
.br \-verbose
.RS 4
Prints stack size, number of locals and arguments for methods\&. Prints stack size, number of locals and arguments for methods\&.
.TP .RE
-classpath \fIpath\fR .PP
.br \-classpath \fIpath\fR
Specifies the path the \f3javap\fR command uses to look up classes\&. Overrides the default or the \f3CLASSPATH\fR environment variable when it is set\&. .RS 4
.TP Specifies the path the
-bootclasspath \fIpath\fR \fBjavap\fR
.br command uses to look up classes\&. Overrides the default or the
Specifies the path from which to load bootstrap classes\&. By default, the bootstrap classes are the classes that implement the core Java platform located in \f3jre/lib/rt\&.jar\fR and several other JAR files\&. \fBCLASSPATH\fR
.TP environment variable when it is set\&.
-extdir \fIdirs\fR .RE
.br .PP
Overrides the location at which installed extensions are searched for\&. The default location for extensions is the value of \f3java\&.ext\&.dirs\fR\&. \-bootclasspath \fIpath\fR
.SH EXAMPLE .RS 4
Compile the following \f3DocFooter\fR class: Specifies the path from which to load bootstrap classes\&. By default, the bootstrap classes are the classes that implement the core Java platform located in
.sp \fBjre/lib/rt\&.jar\fR
.nf and several other JAR files\&.
\f3import java\&.awt\&.*;\fP .RE
.fi .PP
.nf \-extdir \fIdirs\fR
\f3import java\&.applet\&.*;\fP .RS 4
.fi Overrides the location at which installed extensions are searched for\&. The default location for extensions is the value of
.nf \fBjava\&.ext\&.dirs\fR\&.
\f3\fP .RE
.fi .SH "EXAMPLE"
.nf .PP
\f3public class DocFooter extends Applet {\fP Compile the following
.fi \fBDocFooter\fR
.nf class:
\f3 String date;\fP .sp
.fi .if n \{\
.nf .RS 4
\f3 String email;\fP .\}
.fi .nf
.nf \fBimport java\&.awt\&.*;\fR
\f3\fP \fBimport java\&.applet\&.*;\fR
.fi \fB \fR
.nf \fBpublic class DocFooter extends Applet {\fR
\f3 public void init() {\fP \fB String date;\fR
.fi \fB String email;\fR
.nf \fB \fR
\f3 resize(500,100);\fP \fB public void init() {\fR
.fi \fB resize(500,100);\fR
.nf \fB date = getParameter("LAST_UPDATED");\fR
\f3 date = getParameter("LAST_UPDATED");\fP \fB email = getParameter("EMAIL");\fR
.fi \fB }\fR
.nf \fB \fR
\f3 email = getParameter("EMAIL");\fP \fB public void paint(Graphics g) {\fR
.fi \fB g\&.drawString(date + " by ",100, 15);\fR
.nf \fB g\&.drawString(email,290,15);\fR
\f3 }\fP \fB }\fR
.fi \fB}\fR
.nf
\f3\fP .fi
.fi .if n \{\
.nf .RE
\f3 public void paint(Graphics g) {\fP .\}
.fi .PP
.nf The output from the
\f3 g\&.drawString(date + " by ",100, 15);\fP \fBjavap DocFooter\&.class\fR
.fi command yields the following:
.nf .sp
\f3 g\&.drawString(email,290,15);\fP .if n \{\
.fi .RS 4
.nf .\}
\f3 }\fP .nf
.fi \fBCompiled from "DocFooter\&.java"\fR
.nf \fBpublic class DocFooter extends java\&.applet\&.Applet {\fR
\f3}\fP \fB java\&.lang\&.String date;\fR
.fi \fB java\&.lang\&.String email;\fR
.nf \fB public DocFooter();\fR
\f3\fP \fB public void init();\fR
.fi \fB public void paint(java\&.awt\&.Graphics);\fR
.sp \fB}\fR
The output from the \f3javap DocFooter\&.class\fR command yields the following:
.sp .fi
.nf .if n \{\
\f3Compiled from "DocFooter\&.java"\fP .RE
.fi .\}
.nf .PP
\f3public class DocFooter extends java\&.applet\&.Applet {\fP The output from
.fi \fBjavap \-c DocFooter\&.class\fR
.nf command yields the following:
\f3 java\&.lang\&.String date;\fP .sp
.fi .if n \{\
.nf .RS 4
\f3 java\&.lang\&.String email;\fP .\}
.fi .nf
.nf \fBCompiled from "DocFooter\&.java"\fR
\f3 public DocFooter();\fP \fBpublic class DocFooter extends java\&.applet\&.Applet {\fR
.fi \fB java\&.lang\&.String date;\fR
.nf \fB java\&.lang\&.String email;\fR
\f3 public void init();\fP
.fi \fB public DocFooter();\fR
.nf \fB Code:\fR
\f3 public void paint(java\&.awt\&.Graphics);\fP \fB 0: aload_0 \fR
.fi \fB 1: invokespecial #1 // Method\fR
.nf \fBjava/applet/Applet\&."<init>":()V\fR
\f3}\fP \fB 4: return \fR
.fi
.nf \fB public void init();\fR
\f3\fP \fB Code:\fR
.fi \fB 0: aload_0 \fR
.sp \fB 1: sipush 500\fR
The output from \f3javap -c DocFooter\&.class\fR command yields the following: \fB 4: bipush 100\fR
.sp \fB 6: invokevirtual #2 // Method resize:(II)V\fR
.nf \fB 9: aload_0 \fR
\f3Compiled from "DocFooter\&.java"\fP \fB 10: aload_0 \fR
.fi \fB 11: ldc #3 // String LAST_UPDATED\fR
.nf \fB 13: invokevirtual #4 // Method\fR
\f3public class DocFooter extends java\&.applet\&.Applet {\fP \fB getParameter:(Ljava/lang/String;)Ljava/lang/String;\fR
.fi \fB 16: putfield #5 // Field date:Ljava/lang/String;\fR
.nf \fB 19: aload_0 \fR
\f3 java\&.lang\&.String date;\fP \fB 20: aload_0 \fR
.fi \fB 21: ldc #6 // String EMAIL\fR
.nf \fB 23: invokevirtual #4 // Method\fR
\f3 java\&.lang\&.String email;\fP \fB getParameter:(Ljava/lang/String;)Ljava/lang/String;\fR
.fi \fB 26: putfield #7 // Field email:Ljava/lang/String;\fR
.nf \fB 29: return \fR
\f3\fP
.fi \fB public void paint(java\&.awt\&.Graphics);\fR
.nf \fB Code:\fR
\f3 public DocFooter();\fP \fB 0: aload_1 \fR
.fi \fB 1: new #8 // class java/lang/StringBuilder\fR
.nf \fB 4: dup \fR
\f3 Code:\fP \fB 5: invokespecial #9 // Method\fR
.fi \fB java/lang/StringBuilder\&."<init>":()V\fR
.nf \fB 8: aload_0 \fR
\f3 0: aload_0 \fP \fB 9: getfield #5 // Field date:Ljava/lang/String;\fR
.fi \fB 12: invokevirtual #10 // Method\fR
.nf \fB java/lang/StringBuilder\&.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\fR
\f3 1: invokespecial #1 // Method\fP \fB 15: ldc #11 // String by \fR
.fi \fB 17: invokevirtual #10 // Method\fR
.nf \fB java/lang/StringBuilder\&.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\fR
\f3java/applet/Applet\&."<init>":()V\fP \fB 20: invokevirtual #12 // Method\fR
.fi \fB java/lang/StringBuilder\&.toString:()Ljava/lang/String;\fR
.nf \fB 23: bipush 100\fR
\f3 4: return \fP \fB 25: bipush 15\fR
.fi \fB 27: invokevirtual #13 // Method\fR
.nf \fB java/awt/Graphics\&.drawString:(Ljava/lang/String;II)V\fR
\f3\fP \fB 30: aload_1 \fR
.fi \fB 31: aload_0 \fR
.nf \fB 32: getfield #7 // Field email:Ljava/lang/String;\fR
\f3 public void init();\fP \fB 35: sipush 290\fR
.fi \fB 38: bipush 15\fR
.nf \fB 40: invokevirtual #13 // Method\fR
\f3 Code:\fP \fBjava/awt/Graphics\&.drawString:(Ljava/lang/String;II)V\fR
.fi \fB 43: return \fR
.nf \fB}\fR
\f3 0: aload_0 \fP
.fi .fi
.nf .if n \{\
\f3 1: sipush 500\fP .RE
.fi .\}
.nf .SH "SEE ALSO"
\f3 4: bipush 100\fP .sp
.fi .RS 4
.nf .ie n \{\
\f3 6: invokevirtual #2 // Method resize:(II)V\fP \h'-04'\(bu\h'+03'\c
.fi .\}
.nf .el \{\
\f3 9: aload_0 \fP .sp -1
.fi .IP \(bu 2.3
.nf .\}
\f3 10: aload_0 \fP
.fi
.nf
\f3 11: ldc #3 // String LAST_UPDATED\fP
.fi
.nf
\f3 13: invokevirtual #4 // Method\fP
.fi
.nf
\f3 getParameter:(Ljava/lang/String;)Ljava/lang/String;\fP
.fi
.nf
\f3 16: putfield #5 // Field date:Ljava/lang/String;\fP
.fi
.nf
\f3 19: aload_0 \fP
.fi
.nf
\f3 20: aload_0 \fP
.fi
.nf
\f3 21: ldc #6 // String EMAIL\fP
.fi
.nf
\f3 23: invokevirtual #4 // Method\fP
.fi
.nf
\f3 getParameter:(Ljava/lang/String;)Ljava/lang/String;\fP
.fi
.nf
\f3 26: putfield #7 // Field email:Ljava/lang/String;\fP
.fi
.nf
\f3 29: return \fP
.fi
.nf
\f3\fP
.fi
.nf
\f3 public void paint(java\&.awt\&.Graphics);\fP
.fi
.nf
\f3 Code:\fP
.fi
.nf
\f3 0: aload_1 \fP
.fi
.nf
\f3 1: new #8 // class java/lang/StringBuilder\fP
.fi
.nf
\f3 4: dup \fP
.fi
.nf
\f3 5: invokespecial #9 // Method\fP
.fi
.nf
\f3 java/lang/StringBuilder\&."<init>":()V\fP
.fi
.nf
\f3 8: aload_0 \fP
.fi
.nf
\f3 9: getfield #5 // Field date:Ljava/lang/String;\fP
.fi
.nf
\f3 12: invokevirtual #10 // Method\fP
.fi
.nf
\f3 java/lang/StringBuilder\&.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\fP
.fi
.nf
\f3 15: ldc #11 // String by \fP
.fi
.nf
\f3 17: invokevirtual #10 // Method\fP
.fi
.nf
\f3 java/lang/StringBuilder\&.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\fP
.fi
.nf
\f3 20: invokevirtual #12 // Method\fP
.fi
.nf
\f3 java/lang/StringBuilder\&.toString:()Ljava/lang/String;\fP
.fi
.nf
\f3 23: bipush 100\fP
.fi
.nf
\f3 25: bipush 15\fP
.fi
.nf
\f3 27: invokevirtual #13 // Method\fP
.fi
.nf
\f3 java/awt/Graphics\&.drawString:(Ljava/lang/String;II)V\fP
.fi
.nf
\f3 30: aload_1 \fP
.fi
.nf
\f3 31: aload_0 \fP
.fi
.nf
\f3 32: getfield #7 // Field email:Ljava/lang/String;\fP
.fi
.nf
\f3 35: sipush 290\fP
.fi
.nf
\f3 38: bipush 15\fP
.fi
.nf
\f3 40: invokevirtual #13 // Method\fP
.fi
.nf
\f3java/awt/Graphics\&.drawString:(Ljava/lang/String;II)V\fP
.fi
.nf
\f3 43: return \fP
.fi
.nf
\f3}\fP
.fi
.nf
\f3\fP
.fi
.sp
.SH SEE\ ALSO
.TP 0.2i
\(bu
javac(1)
.TP 0.2i
\(bu
java(1) java(1)
.TP 0.2i .RE
\(bu .sp
jdb(1) .RS 4
.TP 0.2i .ie n \{\
\(bu \h'-04'\(bu\h'+03'\c
javah(1) .\}
.TP 0.2i .el \{\
\(bu .sp -1
.IP \(bu 2.3
.\}
javac(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
javadoc(1) javadoc(1)
.RE .RE
.br .sp
'pl 8.5i .RS 4
'bp .ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
javah(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
jdb(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
jdeps(1)
.RE
.br
'pl 8.5i
'bp
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册