The Wayback Machine - https://web.archive.org/web/20240620213254/https://www.geeksforgeeks.org/javap-tool-in-java-with-examples/
Open In App

javap tool in Java with Examples

Last Updated : 10 May, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

javap tool


The javap tool is used to get the information of any class or interface. The javap command (also known as the Java Disassembler) disassembles one or more class files. Its output depends on the options used (“-c” or “-verbose” for byte code and byte code along with innards info, respectively). If no options are used, javap prints out the package, protected, and public fields and methods of the classes passed to it.
Syntax:

javap [option] [classname]

When no options are used:
Syntax:

javap class_name

Output:

When Options are used:

The description and implementation of options are given below:
Note: Some options prints very long output which can’t be shown completely. Please try in your System to view the complete output of options used.

  • -help or –help or -? :
    This option prints a help message for the javap command.
    Syntax:

    javap -help
    

    Output:

  • -version :
    This option prints Version information of java.
    Syntax:

    javap -version
    

    Output:

  • -v or -verbose :
    This option Prints additional information like stack size, number of locals and arguments for methods.
    Syntax:

    javap -v class_name
    

    Output:

  • -l :
    This option prints line number and local variable tables.
    Syntax:

    javap -l class_name
    

    Output:

  • -public :
    This option prints only public classes and members.
    Syntax:

    javap -public class_name
    

    Output:

  • -protected :
    This option prints protected/public classes and members.
    Syntax:

    javap -protected class_name
    

    Output:

  • -package :
    This option prints package/protected/public classes and members (default).
    Syntax:

    javap -package class_name
    

    Output:

  • -c :
    This option prints Disassembled code.
    Syntax:

    javap -c class_name
    

    Output:

  • -s :
    This option prints internal type signatures.
    Syntax:

    javap -s class_name
    

    Output:

  • -sysinfo :
    This option prints system info (path, size, date, MD5 hash) of class being processed.
    Syntax:

    javap -sysinfo class_name
    

    Output:

  • -constants :
    This option prints final constants of class.
    Syntax:

    javap -constants class_name
    

    Output:

  • References: https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javap.html


Similar Reads

How to create a user defined javap tool?
What is a javap tool? The javap tool is used to get the information of any class or interface. The javap command (also known as the Java Disassembler) disassembles one or more class files. Its output depends on the options used ("-c" or "-verbose" for byte code and byte code along with innards info, respectively). If no options are used, javap prin
4 min read
Java Deprecated API Scanner tool (jdepscan) in Java 9 with Examples
Java Deprecated API Scanner tool: Java Deprecated API Scanner tool i.e. jdeprscan is a static analyzing command-line tool which is introduced in JDK 9 for find out the uses of deprecated API in the given input. Here the input can be .class file name, directory or JAR file. Whenever we provide any input to jdeprscan command line tool then it generat
2 min read
JSwing | Create a Magnifying tool using Java Robot
Java Robot is a part of Java AWT (Abstract Window Toolkit ) package . Java Robot is used to generate native system input events for the purposes of test automation, self-running demos, and other applications where control of the mouse and keyboard is needed. The purpose of using Java Robot is to gain the control of input events such as mouse, keybo
2 min read
JEP Package Tool in Java
J package tool was introduced as an incubation tool in java 14. It remained an incubation tool till java 15. It packages java applications into platform-specific features. Basically, this tool converts our java source file into an executable file. In Windows, the executable file is of two types .exe and .msi. In ubuntu its of type .rpm and .deb. J
3 min read
How to Implement a Simple Network Monitoring Tool in Java?
In Java, to perform the simple operation of networked systems, admins and users need network monitoring tools. In this article, we will learn how to make a simple Java-based network monitoring tool that lets users keep track of network devices. Steps to Implement a Simple Network Monitoring Tool in JavaThe steps to implement a simple network monito
2 min read
Difference Between java.sql.Time, java.sql.Timestamp and java.sql.Date in Java
Across the software projects, we are using java.sql.Time, java.sql.Timestamp and java.sql.Date in many instances. Whenever the java application interacts with the database, we should use these instead of java.util.Date. The reason is JDBC i.e. java database connectivity uses these to identify SQL Date and Timestamp. Here let us see the differences
7 min read
How to Create and Setup Spring Boot Project in Spring Tool Suite?
Spring Boot is built on the top of the spring and contains all the features of spring. And is becoming a favorite of developers these days because of its rapid production-ready environment which enables the developers to directly focus on the logic instead of struggling with the configuration and setup. Spring Boot is a microservice-based framework
3 min read
How to Run Your First Spring Boot Application in Spring Tool Suite?
Spring Tool Suite (STS) is a java IDE tailored for developing Spring-based enterprise applications. It is easier, faster, and more convenient. And most importantly it is based on Eclipse IDE. STS is free, open-source, and powered by VMware. Spring Tools 4 is the next generation of Spring tooling for the favorite coding environment. Largely rebuilt
3 min read
How to Create a Dynamic Web Project in Eclipse/Spring Tool Suite?
Eclipse is an Integrated Development Environment (IDE) used in computer programming. It includes a base workspace and an extensible plug-in system for customizing the environment. It is the second-most-popular IDE for Java development. Eclipse is written mostly in Java and its primary use is for developing Java applications, but it may also be used
2 min read
How to Turn on Code Suggestion in Eclipse or Spring Tool Suite?
Eclipse is an Integrated Development Environment (IDE) used in computer programming. It includes a base workspace and an extensible plug-in system for customizing the environment. It is the second-most-popular IDE for Java development. Eclipse is written mostly in Java and its primary use is for developing Java applications, but it may also be used
2 min read
Article Tags :
Practice Tags :