Questions tagged [javap]
javap - The Java Class File Disassembler
javap
125
questions
5
votes
4
answers
2k
views
Java: initialization and costructor of anonymous classes
I would like to understand a strange behavior I faced dealing with anonymous classes.
I have a class that calls a protected method inside its constructor (I know, poor design but that's another story....
0
votes
2
answers
357
views
How to read the metadata for the mnemonics produced by disassembled Java Bytecode? [closed]
I've never used Javap before. Could someone explain what "Code" means in this example? It shows up threes time. What does it mean in the context of the mnemonics that follow on the lines below it? ...
1
vote
1
answer
747
views
javap -c -v -l -s HelloWorld.class doesn't show LocalVariableTable
I'm trying to understand Java byte codes. I profile my simple HelloWorld with the command javap -c -v -l -s HelloWorld.class. But, I'm not able to see the LocalVariableTable entry. Why is that? Is it ...
3
votes
1
answer
2k
views
Java cannot find the class file, while javap can
I have compiled a class (called Test.class) using the Java ASM library. I decided to try and ensure that I had properly compiled the class by attempting to run it using the "java" command.
However, ...
5
votes
1
answer
1k
views
Can javap show the original source code lines intermingled with the bytecode like objdump -S?
I know this debug information is contained in the .class file when compiling
with:
javac -g Main.java
and can be observed manually from the LineNumberTable: section of:
javap -c -constants -...
4
votes
3
answers
2k
views
.class file contains no variable names although setting to create those is activated
I try to find the reason for a strange effect with .class files. It seems like for interfaces the names of variables passed into a function are not listed, but in implementation classes they are. I ...
5
votes
3
answers
348
views
What does no flags for field means in Class format in JAVA?
Here is my snippet of code :
public class Test {
public static void main(String[] args) {
class EnglishHelloThere {
int a=10;
}
}
}
I created a local class ...
12
votes
2
answers
14k
views
Constructor Inside Inner Static Class in java?
I Wrote the following Code
public class Reader1 {
private int pageNumber;
private class ReaderName1{
public int getPage(){
return pageNumber;
}
}
static ...
1
vote
3
answers
535
views
Relationship between Inner and Outer Class in Java?
This is my Book.java code
public class Book {
private int pageNumber;
private class BookReader{
public int getPage(){
return pageNumber;
}
}
}
When I ...
4
votes
1
answer
475
views
Make Java compiler include symbolic constant field reference in class file - possible?
It is well known that the Java compiler pulls in constant field values from other classes at compile time. The resulting class file does not contain a Constant Pool entry (of any type) for such ...
0
votes
1
answer
233
views
Where is the method getDriver initialized in java.sql.DriverManager in JAVA?
I was going through classes in sql package. And i happened to look through the methods in DriverManager.class by "javap DriverManager.class". It shows a method of Driver class- get Driver , if i am ...
1
vote
0
answers
392
views
Bug in Local variable Table construction when Using Javap -v?
I tried the following code :
class testingFinally {
public static String getMessage() {
String s = "hi";
try {
return s;
} finally {
s = null;
}
}
public static ...
1
vote
1
answer
399
views
How to use javap to see what lines of bytecode correspond to lines in the Java code?
I was tasked to make a method that calculates the magnitude of a given vector and then used javap -c to break it down.
Now I must show what each local variable in the magnitude frame corresponds to ...
0
votes
0
answers
845
views
Can we Use Javap command inside a java program?
I need to write a program where I can track the way how methods are called. So , i'm trying to use invokestatic, invokevirtual , invokeinterface , invokespecial to track the method calls and follow ...
1
vote
1
answer
195
views
Java & Javap: How to Determine Which Object Receives Invokevirtual
I am looking through the output of Javap. For example:
This code
final Foo foo = new Foo(1,2);
...
new Callable<Integer>()
{
@Override
public Integer call() ...