{
    "mode": "man",
    "parameter": "javap",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/javap/1/json",
    "generated": "2026-06-15T13:13:32Z",
    "synopsis": "javap [options] classfile...\noptions\nThe command-line options. See Options.\nclassfile\nOne or more classes separated by spaces to be processed for annotations such as\nDocFooter.class. You can specify a class that can be found in the class path, by its file\nname or with a URL such as file:///home/user/myproject/src/DocFooter.class.",
    "sections": {
        "NAME": {
            "content": "javap - Disassembles one or more class files.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "javap [options] classfile...\n\noptions\nThe command-line options. See Options.\n\nclassfile\nOne or more classes separated by spaces to be processed for annotations such as\nDocFooter.class. You can specify a class that can be found in the class path, by its file\nname or with a URL such as file:///home/user/myproject/src/DocFooter.class.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The javap command disassembles one or more class files. The output depends on the options\nused. When no options are used, then the javap command prints the package, protected and\npublic fields, and methods of the classes passed to it. The javap command prints its output\nto stdout.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-help",
                    "content": ""
                },
                {
                    "name": "--help",
                    "content": "-?\nPrints a help message for the javap command.\n",
                    "long": "--help"
                },
                {
                    "name": "-version",
                    "content": "Prints release information.\n"
                },
                {
                    "name": "-l",
                    "content": "Prints line and local variable tables.\n",
                    "flag": "-l"
                },
                {
                    "name": "-public",
                    "content": "Shows only public classes and members.\n"
                },
                {
                    "name": "-protected",
                    "content": "Shows only protected and public classes and members.\n"
                },
                {
                    "name": "-private",
                    "content": ""
                },
                {
                    "name": "-p",
                    "content": "Shows all classes and members.\n",
                    "flag": "-p"
                },
                {
                    "name": "-J_option_",
                    "content": "Passes the specified option to the JVM. For example:\n\njavap -J-version\njavap -J-Djava.security.manager -J-Djava.security.policy=MyPolicy MyClassName\n\nFor more information about JVM options, see the command documentation.\n"
                },
                {
                    "name": "-s",
                    "content": "Prints internal type signatures.\n",
                    "flag": "-s"
                },
                {
                    "name": "-sysinfo",
                    "content": "Shows system information (path, size, date, MD5 hash) of the class being processed.\n"
                },
                {
                    "name": "-constants",
                    "content": "Shows static final constants.\n"
                },
                {
                    "name": "-c",
                    "content": "Prints disassembled code, for example, the instructions that comprise the Java bytecodes,\nfor each of the methods in the class.\n",
                    "flag": "-c"
                },
                {
                    "name": "-verbose",
                    "content": "Prints stack size, number of locals and arguments for methods.\n\n-classpath path\nSpecifies the path the javap command uses to look up classes. Overrides the default or\nthe CLASSPATH environment variable when it is set.\n\n-bootclasspath path\nSpecifies the path from which to load bootstrap classes. By default, the bootstrap\nclasses are the classes that implement the core Java platform located in jre/lib/rt.jar\nand several other JAR files.\n\n-extdir dirs\nOverrides the location at which installed extensions are searched for. The default\nlocation for extensions is the value of java.ext.dirs.\n"
                }
            ]
        },
        "EXAMPLE": {
            "content": "Compile the following DocFooter class:\n\nimport java.awt.*;\nimport java.applet.*;\n\npublic class DocFooter extends Applet {\nString date;\nString email;\n\npublic void init() {\nresize(500,100);\ndate = getParameter(\"LASTUPDATED\");\nemail = getParameter(\"EMAIL\");\n}\n\npublic void paint(Graphics g) {\ng.drawString(date + \" by \",100, 15);\ng.drawString(email,290,15);\n}\n}\n\n\nThe output from the javap DocFooter.class command yields the following:\n\nCompiled from \"DocFooter.java\"\npublic class DocFooter extends java.applet.Applet {\njava.lang.String date;\njava.lang.String email;\npublic DocFooter();\npublic void init();\npublic void paint(java.awt.Graphics);\n}\n\n\nThe output from javap -c DocFooter.class command yields the following:\n\nCompiled from \"DocFooter.java\"\npublic class DocFooter extends java.applet.Applet {\njava.lang.String date;\njava.lang.String email;\n\npublic DocFooter();\nCode:\n0: aload0\n1: invokespecial #1                  // Method\njava/applet/Applet.\"<init>\":()V\n4: return\n\npublic void init();\nCode:\n0: aload0\n1: sipush        500\n4: bipush        100\n6: invokevirtual #2                  // Method resize:(II)V\n9: aload0\n10: aload0\n11: ldc           #3                  // String LASTUPDATED\n13: invokevirtual #4                  // Method\ngetParameter:(Ljava/lang/String;)Ljava/lang/String;\n16: putfield      #5                  // Field date:Ljava/lang/String;\n19: aload0\n20: aload0\n21: ldc           #6                  // String EMAIL\n23: invokevirtual #4                  // Method\ngetParameter:(Ljava/lang/String;)Ljava/lang/String;\n26: putfield      #7                  // Field email:Ljava/lang/String;\n29: return\n\npublic void paint(java.awt.Graphics);\nCode:\n0: aload1\n1: new           #8                  // class java/lang/StringBuilder\n4: dup\n5: invokespecial #9                  // Method\njava/lang/StringBuilder.\"<init>\":()V\n8: aload0\n9: getfield      #5                  // Field date:Ljava/lang/String;\n12: invokevirtual #10                 // Method\njava/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n15: ldc           #11                 // String  by\n17: invokevirtual #10                 // Method\njava/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n20: invokevirtual #12                 // Method\njava/lang/StringBuilder.toString:()Ljava/lang/String;\n23: bipush        100\n25: bipush        15\n27: invokevirtual #13                 // Method\njava/awt/Graphics.drawString:(Ljava/lang/String;II)V\n30: aload1\n31: aload0\n32: getfield      #7                  // Field email:Ljava/lang/String;\n35: sipush        290\n38: bipush        15\n40: invokevirtual #13                 // Method\njava/awt/Graphics.drawString:(Ljava/lang/String;II)V\n43: return\n}\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "•   java(1)\n\n•   javac(1)\n\n•   javadoc(1)\n\n•   javah(1)\n\n•   jdb(1)\n\n•   jdeps(1)\n\n\n\nJDK 8                                       8 August 2014                                   javap(1)",
            "subsections": []
        }
    },
    "summary": "javap - Disassembles one or more class files.",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--help",
            "arg": null,
            "description": "-? Prints a help message for the javap command."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Prints release information."
        },
        {
            "flag": "-l",
            "long": null,
            "arg": null,
            "description": "Prints line and local variable tables."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Shows only public classes and members."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Shows only protected and public classes and members."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "Shows all classes and members."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Passes the specified option to the JVM. For example: javap -J-version javap -J-Djava.security.manager -J-Djava.security.policy=MyPolicy MyClassName For more information about JVM options, see the command documentation."
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": "Prints internal type signatures."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Shows system information (path, size, date, MD5 hash) of the class being processed."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Shows static final constants."
        },
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": "Prints disassembled code, for example, the instructions that comprise the Java bytecodes, for each of the methods in the class."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Prints stack size, number of locals and arguments for methods. -classpath path Specifies the path the javap command uses to look up classes. Overrides the default or the CLASSPATH environment variable when it is set. -bootclasspath path 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 jre/lib/rt.jar and several other JAR files. -extdir dirs Overrides the location at which installed extensions are searched for. The default location for extensions is the value of java.ext.dirs."
        }
    ],
    "examples": [
        "Compile the following DocFooter class:",
        "import java.awt.*;",
        "import java.applet.*;",
        "public class DocFooter extends Applet {",
        "String date;",
        "String email;",
        "public void init() {",
        "resize(500,100);",
        "date = getParameter(\"LASTUPDATED\");",
        "email = getParameter(\"EMAIL\");",
        "public void paint(Graphics g) {",
        "g.drawString(date + \" by \",100, 15);",
        "g.drawString(email,290,15);",
        "The output from the javap DocFooter.class command yields the following:",
        "Compiled from \"DocFooter.java\"",
        "public class DocFooter extends java.applet.Applet {",
        "java.lang.String date;",
        "java.lang.String email;",
        "public DocFooter();",
        "public void init();",
        "public void paint(java.awt.Graphics);",
        "The output from javap -c DocFooter.class command yields the following:",
        "Compiled from \"DocFooter.java\"",
        "public class DocFooter extends java.applet.Applet {",
        "java.lang.String date;",
        "java.lang.String email;",
        "public DocFooter();",
        "Code:",
        "0: aload0",
        "1: invokespecial #1                  // Method",
        "java/applet/Applet.\"<init>\":()V",
        "4: return",
        "public void init();",
        "Code:",
        "0: aload0",
        "1: sipush        500",
        "4: bipush        100",
        "6: invokevirtual #2                  // Method resize:(II)V",
        "9: aload0",
        "10: aload0",
        "11: ldc           #3                  // String LASTUPDATED",
        "13: invokevirtual #4                  // Method",
        "getParameter:(Ljava/lang/String;)Ljava/lang/String;",
        "16: putfield      #5                  // Field date:Ljava/lang/String;",
        "19: aload0",
        "20: aload0",
        "21: ldc           #6                  // String EMAIL",
        "23: invokevirtual #4                  // Method",
        "getParameter:(Ljava/lang/String;)Ljava/lang/String;",
        "26: putfield      #7                  // Field email:Ljava/lang/String;",
        "29: return",
        "public void paint(java.awt.Graphics);",
        "Code:",
        "0: aload1",
        "1: new           #8                  // class java/lang/StringBuilder",
        "4: dup",
        "5: invokespecial #9                  // Method",
        "java/lang/StringBuilder.\"<init>\":()V",
        "8: aload0",
        "9: getfield      #5                  // Field date:Ljava/lang/String;",
        "12: invokevirtual #10                 // Method",
        "java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;",
        "15: ldc           #11                 // String  by",
        "17: invokevirtual #10                 // Method",
        "java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;",
        "20: invokevirtual #12                 // Method",
        "java/lang/StringBuilder.toString:()Ljava/lang/String;",
        "23: bipush        100",
        "25: bipush        15",
        "27: invokevirtual #13                 // Method",
        "java/awt/Graphics.drawString:(Ljava/lang/String;II)V",
        "30: aload1",
        "31: aload0",
        "32: getfield      #7                  // Field email:Ljava/lang/String;",
        "35: sipush        290",
        "38: bipush        15",
        "40: invokevirtual #13                 // Method",
        "java/awt/Graphics.drawString:(Ljava/lang/String;II)V",
        "43: return"
    ],
    "see_also": [
        {
            "name": "java",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/java/1/json"
        },
        {
            "name": "javac",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/javac/1/json"
        },
        {
            "name": "javadoc",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/javadoc/1/json"
        },
        {
            "name": "javah",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/javah/1/json"
        },
        {
            "name": "jdb",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/jdb/1/json"
        },
        {
            "name": "jdeps",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/jdeps/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Disassemble class files and list them.",
        "examples": [
            {
                "description": "Disassemble and list one or more `.class` files",
                "command": "javap {{path/to/file1.class path/to/file2.class ...}}"
            },
            {
                "description": "Disassemble and list a built-in class file",
                "command": "javap java.{{package}}.{{class}}"
            },
            {
                "description": "Display help",
                "command": "javap -help"
            },
            {
                "description": "Display version",
                "command": "javap -version"
            }
        ]
    }
}