src/linux/doc/man/ja/javap.1

Print this page


   1 ." Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
   2 ." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   3 ."
   4 ." This code is free software; you can redistribute it and/or modify it
   5 ." under the terms of the GNU General Public License version 2 only, as
   6 ." published by the Free Software Foundation.
   7 ."
   8 ." This code is distributed in the hope that it will be useful, but WITHOUT
   9 ." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10 ." FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  11 ." version 2 for more details (a copy is included in the LICENSE file that
  12 ." accompanied this code).
  13 ."
  14 ." You should have received a copy of the GNU General Public License version
  15 ." 2 along with this work; if not, write to the Free Software Foundation,
  16 ." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  17 ."
  18 ." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19 ." or visit www.oracle.com if you need additional information or have any
  20 ." questions.
  21 ."
  22 .TH javap 1 "07 May 2011"
  23 
  24 .LP
  25 .SH "名前"
  26 javap \- Java クラスファイル逆アセンブラ
  27 .LP
  28 .LP
  29 クラスファイルを逆アセンブルします。
  30 .LP
  31 .SH "形式"
  32 .LP

























  33 .nf
  34 \f3
  35 .fl
  36 javap [ \fP\f3options\fP\f3 ] classes
  37 .fl
  38 \fP
  39 .fi
  40 
  41 .LP











  42 .SH "説明"
  43 .LP
  44 .LP
  45 \f3javap\fP コマンドは、1 つまたは複数のクラスファイルを逆アセンブルします。その出力は指定するオプションにより異なります。オプションを指定しない場合、\f3javap\fP は、そのパッケージ、渡されたクラスの protected および public のフィールドとメソッドを出力します。\f3javap\fP はその出力を標準出力に表示します。
  46 .LP
  47 .RS 3
  48 .TP 3
  49 options 
  50 コマンド行オプション。 
  51 .TP 3
  52 classes 
  53 注釈の処理対象となる 1 つ以上のクラス \f2DocFooter.class\fP など) のリスト (空白区切り)。クラスパスで見つかるクラスは、ファイル名 ( \f2/home/user/myproject/src/DocFooter.class\fP など) または URL ( \f2file:///home/user/myproject/src/DocFooter.class\fP など) で指定できます。 
  54 .RE
  55 
  56 .LP
  57 .LP
  58 たとえば、次のクラス宣言をコンパイルするとします。
  59 .LP




























  60 .nf
  61 \f3
  62 .fl
  63 import java.awt.*;
  64 .fl
  65 import java.applet.*;
  66 .fl




















































  67 
  68 .fl
  69 public class DocFooter extends Applet {
  70 .fl
  71         String date;
  72 .fl
  73         String email;
  74 .fl
  75 
  76 .fl
  77         public void init() {
  78 .fl
  79                 resize(500,100);
  80 .fl
  81                 date = getParameter("LAST_UPDATED");
  82 .fl
  83                 email = getParameter("EMAIL");
  84 .fl
  85         }
  86 .fl
  87 
  88 .fl
  89         public void paint(Graphics g) {
  90 .fl
  91                 g.drawString(date + " by ",100, 15);
  92 .fl
  93                 g.drawString(email,290,15);
  94 .fl
  95         }
  96 .fl
  97 }
  98 .fl
  99 \fP
 100 .fi
 101 
 102 .LP
 103 .LP
 104 \f3javap DocFooter.class\fP がもたらす出力は次のようになります。
 105 .LP




 106 .nf
 107 \f3
 108 .fl
 109 Compiled from "DocFooter.java"
 110 .fl
 111 public class DocFooter extends java.applet.Applet {
 112 .fl
 113   java.lang.String date;
 114 .fl
 115   java.lang.String email;
 116 .fl
 117   public DocFooter();
 118 .fl
 119   public void init();
 120 .fl
 121   public void paint(java.awt.Graphics);
 122 .fl
 123 }
 124 .fl
 125 \fP
 126 .fi
 127 
 128 .LP
 129 .LP
 130 \f3javap \-c DocFooter.class\fP がもたらす出力は次のようになります。
 131 .LP




 132 .nf
 133 \f3
 134 .fl
 135 Compiled from "DocFooter.java"
 136 .fl
 137 public class DocFooter extends java.applet.Applet {
 138 .fl
 139   java.lang.String date;
 140 .fl
 141 
 142 .fl
 143   java.lang.String email;
 144 .fl
 145 
 146 .fl
 147   public DocFooter();
 148 .fl
 149     Code:
 150 .fl
 151        0: aload_0       
 152 .fl
 153        1: invokespecial #1                  // Method java/applet/Applet."<init>":()V
 154 .fl
 155        4: return        
 156 .fl
 157 
 158 .fl
 159   public void init();
 160 .fl
 161     Code:
 162 .fl
 163        0: aload_0       
 164 .fl
 165        1: sipush        500
 166 .fl
 167        4: bipush        100
 168 .fl
 169        6: invokevirtual #2                  // Method resize:(II)V
 170 .fl
 171        9: aload_0       
 172 .fl
 173       10: aload_0       
 174 .fl
 175       11: ldc           #3                  // String LAST_UPDATED
 176 .fl
 177       13: invokevirtual #4                  // Method getParameter:(Ljava/lang/String;)Ljava/lang/String;
 178 .fl
 179       16: putfield      #5                  // Field date:Ljava/lang/String;
 180 .fl
 181       19: aload_0       
 182 .fl
 183       20: aload_0       
 184 .fl
 185       21: ldc           #6                  // String EMAIL
 186 .fl
 187       23: invokevirtual #4                  // Method getParameter:(Ljava/lang/String;)Ljava/lang/String;
 188 .fl
 189       26: putfield      #7                  // Field email:Ljava/lang/String;
 190 .fl
 191       29: return        
 192 .fl
 193 
 194 .fl
 195   public void paint(java.awt.Graphics);
 196 .fl
 197     Code:
 198 .fl
 199        0: aload_1       
 200 .fl
 201        1: new           #8                  // class java/lang/StringBuilder
 202 .fl
 203        4: dup           
 204 .fl
 205        5: invokespecial #9                  // Method java/lang/StringBuilder."<init>":()V
 206 .fl
 207        8: aload_0       
 208 .fl
 209        9: getfield      #5                  // Field date:Ljava/lang/String;
 210 .fl
 211       12: invokevirtual #10                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
 212 .fl
 213       15: ldc           #11                 // String  by 
 214 .fl
 215       17: invokevirtual #10                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
 216 .fl
 217       20: invokevirtual #12                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
 218 .fl
 219       23: bipush        100
 220 .fl
 221       25: bipush        15
 222 .fl
 223       27: invokevirtual #13                 // Method java/awt/Graphics.drawString:(Ljava/lang/String;II)V
 224 .fl
 225       30: aload_1       
 226 .fl
 227       31: aload_0       
 228 .fl
 229       32: getfield      #7                  // Field email:Ljava/lang/String;
 230 .fl
 231       35: sipush        290
 232 .fl
 233       38: bipush        15
 234 .fl
 235       40: invokevirtual #13                 // Method java/awt/Graphics.drawString:(Ljava/lang/String;II)V
 236 .fl
 237       43: return        
 238 .fl
 239 }
 240 .fl
 241 \fP
 242 .fi
 243 
 244 .LP
 245 .SH "オプション"
 246 .LP
 247 .RS 3
 248 .TP 3
 249 \-help \-\-help \-? 
 250 \f3javap\fP のヘルプメッセージを出力します。 
 251 .TP 3
 252 \-version 
 253 バージョン情報を表示します。 
 254 .TP 3
 255 \-l 
 256 行番号と局所変数テーブルを表示します。 
 257 .TP 3
 258 \-public 
 259 public クラスおよびメンバーだけを表示します。 
 260 .TP 3
 261 \-protected 
 262 protected および public のクラスとメンバーだけを表示します。 
 263 .TP 3
 264 \-package 
 265 package、protected、および public のクラスとメンバーだけを表示します。これはデフォルトの設定です。 
 266 .TP 3
 267 \-private \-p 
 268 すべてのクラスとメンバーを表示します。 
 269 .TP 3
 270 \-Jflag 
 271 ランタイムシステムに直接 \f2flag\fP を渡します。使用例を次に示します。 
 272 .nf
 273 \f3
 274 .fl
 275 javap \-J\-version
 276 .fl
 277 javap \-J\-Djava.security.manager \-J\-Djava.security.policy=MyPolicy MyClassName
 278 .fl
 279 \fP
 280 .fi
 281 .TP 3
 282 \-s 
 283 内部の型シグニチャーを出力します。 
 284 .TP 3
 285 \-sysinfo 
 286 処理中のクラスのシステム情報 (パス、サイズ、日付、MD5 ハッシュ) を表示します。 
 287 .TP 3
 288 \-constants 
 289 static final 定数を表示します。 
 290 .TP 3
 291 \-c 
 292 クラスの各メソッドのために逆アセンブルされるコード、すなわち Java バイトコードから成る命令を表示します。これらは
 293 .na
 294 \f2「Java Virtual Machine Specification」\fP @
 295 .fi
 296 http://java.sun.com/docs/books/vmspec/にドキュメント化されています。 
 297 .TP 3
 298 \-verbose 
 299 メソッドのスタックサイズ、および \f2locals\fP と \f2args\fP の数を出力します。 
 300 .TP 3
 301 \-classpath path 
 302 \f3javap\fP がクラスを探すために使用するパスを指定します。デフォルトまたは CLASSPATH 環境変数設定を上書きします。 
 303 .TP 3
 304 \-bootclasspath path 
 305 ブートストラップクラスをロードするパスを指定します。ブートストラップクラスは、デフォルトでは \f2jre/lib/rt.jar\fP および他のいくつかの JAR ファイル にある、コア Java 2 プラットフォームを実装するクラスです。 
 306 .TP 3
 307 \-extdirs dirs 
 308 インストールされた拡張機能を検索する場所をオーバーライドします。拡張機能は、デフォルトでは \f2java.ext.dirs\fP にあります。 
 309 .RE
 310 
 311 .LP
 312 .SH "関連項目"
 313 .LP
 314 .LP
 315 javac(1)、java(1)、jdb(1)、javah(1)、javadoc(1)
 316 .LP
 317  





















































   1 '\" t
   2 .\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
   3 .\" Title: javap
   4 .\" Language: English
   5 .\" Date: 2013年11月21日
   6 .\" SectDesc: 基本ツール
   7 .\" Software: JDK 8
   8 .\" Arch: 汎用
   9 .\"
  10 .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  11 .\"
  12 .\" This code is free software; you can redistribute it and/or modify it
  13 .\" under the terms of the GNU General Public License version 2 only, as
  14 .\" published by the Free Software Foundation.
  15 .\"
  16 .\" This code is distributed in the hope that it will be useful, but WITHOUT
  17 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  18 .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  19 .\" version 2 for more details (a copy is included in the LICENSE file that
  20 .\" accompanied this code).
  21 .\"
  22 .\" You should have received a copy of the GNU General Public License version
  23 .\" 2 along with this work; if not, write to the Free Software Foundation,
  24 .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  25 .\"
  26 .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  27 .\" or visit www.oracle.com if you need additional information or have any
  28 .\" questions.
  29 .\"
  30 .pl 99999
  31 .TH "javap" "1" "2013年11月21日" "JDK 8" "基本ツール"
  32 .\" -----------------------------------------------------------------
  33 .\" * Define some portability stuff
  34 .\" -----------------------------------------------------------------
  35 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  36 .\" http://bugs.debian.org/507673
  37 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  38 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  39 .ie \n(.g .ds Aq \(aq
  40 .el       .ds Aq '
  41 .\" -----------------------------------------------------------------
  42 .\" * set default formatting
  43 .\" -----------------------------------------------------------------
  44 .\" disable hyphenation
  45 .nh
  46 .\" disable justification (adjust text to left margin only)
  47 .ad l
  48 .\" -----------------------------------------------------------------
  49 .\" * MAIN CONTENT STARTS HERE *
  50 .\" -----------------------------------------------------------------
  51 .SH "NAME"
  52 javap \- 1つ以上のクラス・ファイルを逆アセンブルします。
  53 .SH "概要"
  54 .sp
  55 .if n \{\
  56 .RS 4
  57 .\}
  58 .nf
  59 \fIjavap\fR [\fIoptions\fR] \fIclassfile\fR\&.\&.\&.




  60 .fi
  61 .if n \{\
  62 .RE
  63 .\}
  64 .PP
  65 \fIoptions\fR
  66 .RS 4
  67 コマンドライン・オプション。オプションを参照してください。
  68 .RE
  69 .PP
  70 \fIclassfile\fR
  71 .RS 4
  72 注釈の処理対象となる、空白で区切った1つ以上のクラス(DocFooter\&.classなど)。クラス・パスで検出できるクラスを、ファイル名またはURL(\fIfile:///home/user/myproject/src/DocFooter\&.class\fRなど)で指定できます。
  73 .RE
  74 .SH "説明"
  75 .PP
  76 \fIjavap\fRコマンドは、1つまたは複数のクラス・ファイルを逆アセンブルします。その出力は指定するオプションにより異なります。オプションを指定しない場合、\fIjavap\fRコマンドは、そのパッケージ、渡されたクラスのprotectedおよびpublicのフィールドとメソッドを出力します。\fIjavap\fRコマンドはその出力を\fI標準出力\fRに表示します。
  77 .SH "オプション"
  78 .PP
  79 \-help, \-\-help, \-?
  80 .RS 4
  81 \fIjavap\fRコマンドについてのヘルプ・メッセージを出力します。




  82 .RE
  83 .PP
  84 \-version
  85 .RS 4
  86 リリース情報を出力します。
  87 .RE
  88 .PP
  89 \-l
  90 .RS 4
  91 行番号とローカル変数表を出力します。
  92 .RE
  93 .PP
  94 \-public
  95 .RS 4
  96 publicクラスおよびメンバーのみ表示します。
  97 .RE
  98 .PP
  99 \-protected
 100 .RS 4
 101 protectedおよびpublicのクラスとメンバーのみを表示します。
 102 .RE
 103 .PP
 104 \-private, \-p
 105 .RS 4
 106 すべてのクラスとメンバーを表示します。
 107 .RE
 108 .PP
 109 \-J\fIoption\fR
 110 .RS 4
 111 指定されたオプションをJVMに渡します。次に例を示します。
 112 .sp
 113 .if n \{\
 114 .RS 4
 115 .\}
 116 .nf
 117 javap \-J\-version
 118 javap \-J\-Djava\&.security\&.manager \-J\-Djava\&.security\&.policy=MyPolicy MyClassName
 119 .fi
 120 .if n \{\
 121 .RE
 122 .\}
 123 JVMオプションの詳細は、コマンドのマニュアルを参照してください。
 124 .RE
 125 .PP
 126 \-s
 127 .RS 4
 128 内部の型シグニチャを出力します。
 129 .RE
 130 .PP
 131 \-sysinfo
 132 .RS 4
 133 処理中のクラスのシステム情報(パス、サイズ、日付、MD5ハッシュ)を表示します。
 134 .RE
 135 .PP
 136 \-constants
 137 .RS 4
 138 \fIstatic final\fR定数を表示します。
 139 .RE
 140 .PP
 141 \-c
 142 .RS 4
 143 クラスの各メソッドのために逆アセンブルされるコード、すなわちJavaバイトコードからなる命令を表示します。
 144 .RE
 145 .PP
 146 \-verbose
 147 .RS 4
 148 メソッドのスタック・サイズ、localsとargumentsの数を出力します。
 149 .RE
 150 .PP
 151 \-classpath \fIpath\fR
 152 .RS 4
 153 クラスを探すために\fIjavap\fRコマンドが使用するパスを指定します。デフォルトまたは\fICLASSPATH\fR環境変数の設定をオーバーライドします。
 154 .RE
 155 .PP
 156 \-bootclasspath \fIpath\fR
 157 .RS 4
 158 ブートストラップ・クラスをロードするパスを指定します。ブートストラップ・クラスは、デフォルトでは\fIjre/lib/rt\&.jar\fRおよび他のいくつかのJARファイルにある、コアJavaプラットフォームを実装するクラスです。
 159 .RE
 160 .PP
 161 \-extdir \fIdirs\fR
 162 .RS 4
 163 インストールされた拡張機能を検索する場所をオーバーライドします。拡張機能のデフォルト位置は\fIjava\&.ext\&.dirs\fRです。
 164 .RE
 165 .SH "例"
 166 .PP
 167 次の\fIDocFooter\fRクラスをコンパイルします。
 168 .sp
 169 .if n \{\
 170 .RS 4
 171 .\}
 172 .nf
 173 import java\&.awt\&.*;
 174 import java\&.applet\&.*;
 175  

 176 public class DocFooter extends Applet {

 177         String date;

 178         String email;

 179  

 180         public void init() {

 181                 resize(500,100);

 182                 date = getParameter("LAST_UPDATED");

 183                 email = getParameter("EMAIL");

 184         }

 185  

 186         public void paint(Graphics g) {
 187                 g\&.drawString(date + " by ",100, 15);
 188                 g\&.drawString(email,290,15);



 189         }

 190 }


 191 .fi
 192 .if n \{\
 193 .RE
 194 .\}
 195 .PP
 196 \fIjavap DocFooter\&.class\fRコマンドからの出力は次を生成します。
 197 .sp
 198 .if n \{\
 199 .RS 4
 200 .\}
 201 .nf
 202 Compiled from "DocFooter\&.java"
 203 public class DocFooter extends java\&.applet\&.Applet {
 204   java\&.lang\&.String date;
 205   java\&.lang\&.String email;






 206   public DocFooter();

 207   public void init();
 208   public void paint(java\&.awt\&.Graphics);


 209 }


 210 .fi
 211 .if n \{\
 212 .RE
 213 .\}
 214 .PP
 215 \fIjavap \-c DocFooter\&.class\fRコマンドからの出力は次を生成します。
 216 .sp
 217 .if n \{\
 218 .RS 4
 219 .\}
 220 .nf
 221 Compiled from "DocFooter\&.java"
 222 public class DocFooter extends java\&.applet\&.Applet {
 223   java\&.lang\&.String date;
 224   java\&.lang\&.String email;








 225 

 226   public DocFooter();

 227     Code:

 228        0: aload_0       
 229        1: invokespecial #1                  // Method
 230 java/applet/Applet\&."<init>":()V

 231        4: return        

 232 

 233   public void init();

 234     Code:

 235        0: aload_0       

 236        1: sipush        500

 237        4: bipush        100

 238        6: invokevirtual #2                  // Method resize:(II)V

 239        9: aload_0       

 240       10: aload_0       

 241       11: ldc           #3                  // String LAST_UPDATED
 242       13: invokevirtual #4                  // Method
 243  getParameter:(Ljava/lang/String;)Ljava/lang/String;

 244       16: putfield      #5                  // Field date:Ljava/lang/String;

 245       19: aload_0       

 246       20: aload_0       

 247       21: ldc           #6                  // String EMAIL
 248       23: invokevirtual #4                  // Method
 249  getParameter:(Ljava/lang/String;)Ljava/lang/String;

 250       26: putfield      #7                  // Field email:Ljava/lang/String;

 251       29: return        

 252 
 253   public void paint(java\&.awt\&.Graphics);


 254     Code:

 255        0: aload_1       

 256        1: new           #8                  // class java/lang/StringBuilder

 257        4: dup           
 258        5: invokespecial #9                  // Method
 259  java/lang/StringBuilder\&."<init>":()V

 260        8: aload_0       

 261        9: getfield      #5                  // Field date:Ljava/lang/String;
 262       12: invokevirtual #10                 // Method
 263  java/lang/StringBuilder\&.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;

 264       15: ldc           #11                 // String  by 
 265       17: invokevirtual #10                 // Method
 266  java/lang/StringBuilder\&.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
 267       20: invokevirtual #12                 // Method
 268  java/lang/StringBuilder\&.toString:()Ljava/lang/String;

 269       23: bipush        100

 270       25: bipush        15
 271       27: invokevirtual #13                 // Method
 272  java/awt/Graphics\&.drawString:(Ljava/lang/String;II)V

 273       30: aload_1       

 274       31: aload_0       

 275       32: getfield      #7                  // Field email:Ljava/lang/String;

 276       35: sipush        290

 277       38: bipush        15
 278       40: invokevirtual #13                 // Method
 279 java/awt/Graphics\&.drawString:(Ljava/lang/String;II)V

 280       43: return        

 281 }


 282 .fi
 283 .if n \{\

































































 284 .RE
 285 .\}

 286 .SH "関連項目"
 287 .sp
 288 .RS 4
 289 .ie n \{\
 290 \h'-04'\(bu\h'+03'\c
 291 .\}
 292 .el \{\
 293 .sp -1
 294 .IP \(bu 2.3
 295 .\}
 296 javac(1)
 297 .RE
 298 .sp
 299 .RS 4
 300 .ie n \{\
 301 \h'-04'\(bu\h'+03'\c
 302 .\}
 303 .el \{\
 304 .sp -1
 305 .IP \(bu 2.3
 306 .\}
 307 java(1)
 308 .RE
 309 .sp
 310 .RS 4
 311 .ie n \{\
 312 \h'-04'\(bu\h'+03'\c
 313 .\}
 314 .el \{\
 315 .sp -1
 316 .IP \(bu 2.3
 317 .\}
 318 jdb(1)
 319 .RE
 320 .sp
 321 .RS 4
 322 .ie n \{\
 323 \h'-04'\(bu\h'+03'\c
 324 .\}
 325 .el \{\
 326 .sp -1
 327 .IP \(bu 2.3
 328 .\}
 329 javah(1)
 330 .RE
 331 .sp
 332 .RS 4
 333 .ie n \{\
 334 \h'-04'\(bu\h'+03'\c
 335 .\}
 336 .el \{\
 337 .sp -1
 338 .IP \(bu 2.3
 339 .\}
 340 javadoc(1)
 341 .RE
 342 .br
 343 'pl 8.5i
 344 'bp