Questions tagged [javap]

javap - The Java Class File Disassembler

javap - The Java Class File Disassembler:

The javap command disassembles one or more class files. Its output depends on the options used. If no options are used, javap prints out the package, protected, and public fields and methods of the classes passed to it. javap prints its output to stdout.

124 questions
1
vote
2 answers

How to check imports of a *.war file?

I have an old war-file where the source code was lost as my old machine passed away. It did run there with tomcat 8 with no problems. On my new machine, when tomcat (8 as well as 9) tries to deploy the war file, it gives me ... 10 more Caused by:…
Gyro Gearloose
  • 1,056
  • 1
  • 9
  • 26
1
vote
1 answer

Intellij on Linux: Menu: jdk > javap option

I use Intellij community 2018 on Ubuntu. How can I have a jdk option in the menu that appears after right clicking inside the editor window? I don't know if this option is built into the IDE or some external plugin. This jdk option should have (at…
rapt
  • 11,810
  • 35
  • 103
  • 145
1
vote
0 answers

What does stack=1 (or any integer value) mean in Java bytecode

I've been trying to understand how the bytecode of the following Java code works. I couldn't find the explanation of what the stack=1 and the stack=4 part mean. Java Code: public class SimpleRecursion { public int factorial(int n) { if…
Youness
  • 57
  • 8
1
vote
1 answer

Javap -l does not show me my local variable table

For some reason, Command prompt isn't providing me with a local variable table, even though I am using the -l option. Any suggestion/points? Edit, here is the code for SumSqrt class: public class SumSqrt { /** Calculates the sum of the square…
1
vote
0 answers

how to map bytecode line number to sourcecode line number

I'm creating a program to find null pointer dereference in java. The methodology used is to first extract java byte code using javap command and then extract control flow graph(CFG) information from it. Once CFG is obtained from byte code, i run an…
Jithin KS
  • 161
  • 2
  • 8
1
vote
0 answers

setting the target version to 1.8 still produce the class files with major version 52

I am trying to compile my java source code to target 1.8. I have set the following in the javac target. Ant version: Apache Ant(TM) version 1.9.4 compiled on April 29 2014 Java version: 1.8
Mayuran
  • 669
  • 2
  • 8
  • 39
1
vote
1 answer

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 being ignored? I'm running java 1.8.0_45 on OS X…
BestCoderEver
  • 467
  • 1
  • 7
  • 15
1
vote
3 answers

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 complied it and used javap I got following things for…
Ankur Anand
  • 3,873
  • 2
  • 23
  • 44
1
vote
0 answers

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 void main(String a[]) { …
TheLostMind
  • 35,966
  • 12
  • 68
  • 104
1
vote
1 answer

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 in the java, and which lines of bytecode correspond…
1
vote
1 answer

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() { @Override public Integer call() throws Exception { return…
David Williams
  • 8,388
  • 23
  • 83
  • 171
1
vote
1 answer

Method signatures and descriptors in class file constant pool (javap)

I am trying to figure out the following two entries under the constant pool section in the class file: int foo(int x) { return x; } #11 = Utf8 foo #12 = Utf8 (I)I // 1 #13 = Utf8 x #14 = Utf8 …
gudge
  • 1,053
  • 4
  • 18
  • 33
1
vote
3 answers

What are static code blocks for?

I want to ask what javap shows besides the public fields and methods of the classes passed to it. I was reviewing a class file having only a static variable. As expected, javap shows the static variable and class constructor as output but it also…
Shashi
  • 746
  • 10
  • 39
1
vote
1 answer

Getting runtime class information from the web? Something like javap but at runtime on class loaded in memory

I am working with Websphere and complicated classloading issues. I want to be able to download or print information that would normally get printed by javap (the methods, etc). I may also need to get the raw binary class data, to perform a binary…
Berlin Brown
  • 11,504
  • 37
  • 135
  • 203
1
vote
2 answers

Recursive javap and save results to files with the same name

I want to decompile .class files in many directories and then save output of every file to file with the same name (of course with different extension). I tried to set classpath, but I receive some errors that one of directories wasn't found, but…
1 2 3
8 9