from small one page howto to huge articles all in one place

search text in:




Other .linuxhowtos.org sites:gentoo.linuxhowtos.org



Last additions:
using iotop to find disk usage hogs

using iotop to find disk usage hogs

words:

887

views:

210204

userrating:


May 25th. 2007:
Words

486

Views

259174

why adblockers are bad


Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

words:

161

views:

150540

userrating:


April, 26th. 2006:

Druckversion
You are here: manpages





JAVAP

Section: JDK Commands (1)
Updated: 2023
Index Return to Main Contents
 

NAME

javap- disassemble one or more class files  

SYNOPSIS

V]javapR] [I]optionsR]] I]classesR]...

I]optionsR]
Specifies the comman-line options. See B]Options for javapR].
I]classesR]
Specifies one or more classes separated by spaces to be processed for annotations. You can specify a class that can be found in the class path by its file name, URL, or by its fully qualified class name.

Examples:

V]path/to/MyClass.classR]

V]jar:file:///path/to/MyJar.jar!/mypkg/MyClass.classR]

V]java.lang.ObjectR]

 

DESCRIPTION

The V]javapR] command disassembles one or more class files. The output depends on the options used. When no options are used, the V]javapR] command prints the protected and public fields, and methods of the classes passed to it.

The V]javapR] command isn[aq]t multirelease JAR aware. Using the class path form of the command results in viewing the base entry in all JAR files, multirelease or not. Using the URL form, you can use the URL form of an argument to specify a specific version of a class to be disassembled.

The V]javapR] command prints its output to V]stdoutR].

B]Note:R]

In tools that support V-R] style options, the GN-style options can use the equal sign (V]=R]) instead of a white space to separate the name of an option from its value.  

OPTIONS FOR JAVAP

V-helpR], V-helpR] , V-hR], or V-?R]
Prints a help message for the V]javapR] command.
V-versionR]
Prints release information.
V-verboseR] or V-vR]
Prints additional information about the selected class.
V-lR]
Prints line and local variable tables.
V-publicR]
Shows only public classes and members.
V-protectedR]
Shows only protected and public classes and members.
V-packageR]
Shows package/protected/public classes and members (default).
V-privateR] or V-pR]
Shows all classes and members.
V-cR]
Prints disassembled code, for example, the instructions that comprise the Java bytecodes, for each of the methods in the class.
V-sR]
Prints internal type signatures.
V-sysinfoR]
Shows system information (path, size, date, SH-256 hash) of the class being processed.
V-constantsR]
Shows V]static finalR] constants.
V-moduleR] I]moduleR] or V-mR] I]moduleR]
Specifies the module containing classes to be disassembled.
V-modul-pathR] I]pathR]
Specifies where to find application modules.
V-systemR] I]jdkR]
Specifies where to find system modules.
V-clas-pathR] I]pathR], V-classpathR] I]pathR], or V-cpR] I]pathR]
Specifies the path that the V]javapR] command uses to find user class files. It overrides the default or the V]CLASSPATHR] environment variable when it[aq]s set.
V-bootclasspathR] I]pathR]
Overrides the location of bootstrap class files.
V-mult-releaseR] I]versionR]
Specifies the version to select in mult-release JAR files.
V-JR]I]optionR]
Passes the specified option to the JVM. For example:
CB]
javap--version

javap--Djava.security.manager--Djava.security.policy=MyPolicy MyClassName
R]

See I]Overview of Java OptionsR] in B]javaR].

 

JAVAP EXAMPLE

Compile the following V]HelloWorldFrameR] class:

CB]
import java.awt.Graphics;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class HelloWorldFrame extends JFrame {

   String message = [dq]Hello World![dq];

   public HelloWorldFrame(){
        setContentPane(new JPanel(){
            [at]Override
            protected void paintComponent(Graphics g) {
                g.drawString(message, 15, 30);
            }
        });
        setSize(100, 100);
    }
    public static void main(String[] args) {
        HelloWorldFrame frame = new HelloWorldFrame();
        frame.setVisible(true);

    }

}
R]

The output from the V]javap HelloWorldFrame.classR] command yields the following:

CB]
Compiled from [dq]HelloWorldFrame.java[dq]
public class HelloWorldFrame extends javax.swing.JFrame {
  java.lang.String message;
  public HelloWorldFrame();
  public static void main(java.lang.String[]);
}
R]

The output from the V]javap-c HelloWorldFrame.classR] command yields the following:

CB]
Compiled from [dq]HelloWorldFrame.java[dq]
public class HelloWorldFrame extends javax.swing.JFrame {
  java.lang.String message;

  public HelloWorldFrame();
    Code:
       0: aload_0
       1: invokespecial #1        // Method javax/swing/JFrame.[dq]<init>[dq]:()V
       4: aload_0
       5: ldc           #2        // String Hello World!
       7: putfield      #3        // Field message:Ljava/lang/String;
      10: aload_0
      11: new           #4        // class HelloWorldFrame$1
      14: dup
      15: aload_0
      16: invokespecial #5        // Method HelloWorldFrame$1.[dq]<init>[dq]:(LHelloWorldFrame;)V
      19: invokevirtual #6        // Method setContentPane:(Ljava/awt/Container;)V
      22: aload_0
      23: bipush        100
      25: bipush        100
      27: invokevirtual #7        // Method setSize:(II)V
      30: return

  public static void main(java.lang.String[]);
    Code:
       0: new           #8        // class HelloWorldFrame
       3: dup
       4: invokespecial #9        // Method [dq]<init>[dq]:()V
       7: astore_1
       8: aload_1
       9: iconst_1
      10: invokevirtual #10       // Method setVisible:(Z)V
      13: return
}
R]


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS FOR JAVAP
JAVAP EXAMPLE





Support us on Content Nation
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2025 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 11.9 ms