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
5
votes
2 answers

Javap Asciz Strings

Little question about the output generated from the javap command regarding the constant pool. When javap prints the pool it defines string constants as Asciz strings, which I understand means null terminated Ascii: const #20 = Asciz hello…
Jivings
  • 22,834
  • 6
  • 60
  • 101
5
votes
1 answer

"bogus" entries in javap local table output

I was using javap to study the code produced for one of my classes and noticed the following output: ... frame_type = 255 /* full_frame */ offset_delta = 11 locals = [ class Test, double, int, double, double, bogus, bogus, int, int, class "[D"…
thkala
  • 84,049
  • 23
  • 157
  • 201
5
votes
2 answers

Scala: using reflection to discover your inner objects (and desires)?

Is there a way to at runtime discover objects declared inside an outer object? The Java Class methods getClasses and getDeclaredClasses both return empty arrays. object Parent { object Child1 object Child2 } println("Children of…
Landon Kuhn
  • 76,451
  • 45
  • 104
  • 130
5
votes
1 answer

Is javap missing some line numbers?

If I compile the following source code: 1. public class Example { 2. public boolean foo(boolean a, boolean b, char ch) { 3. if (a && Character.isLetter(ch) 4. || b && Character.isDigit(ch) 5. || !a && !b) { 6. …
josecampos
  • 851
  • 1
  • 8
  • 25
5
votes
4 answers

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...) public class A { public A() { init(); …
ugo
  • 181
  • 1
  • 8
5
votes
1 answer

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 -private -verbose '$<' > '$@' What I want is to make…
Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
5
votes
3 answers

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 to see what kind of access modifier do i get when…
user4822607
5
votes
2 answers

javap in a programmable way

Can we use javap in our own java code in a programmable way? for example, the following code: public class TestClass { public static void main(String[] args) { System.out.println("hello world"); } } using javap in command line, we…
DON1101
  • 83
  • 3
4
votes
1 answer

Problem marking the lines in the java compiler

I am a master's student and I am researching static analysis. In one of my tests I came across a problem in marking lines in the java compiler. I have the following java code: 226: String json =…
4
votes
2 answers

java JVM bytecode notation, comment grammar. InvokeDynamic

Question: What does line 14 means? Use javap -v -c to disassembly the following code: public class test { static int i = 2; public static void main(String[] args) { test x = new test(); System.out.println("text +…
schen
  • 107
  • 1
  • 2
  • 7
4
votes
4 answers

JDK installed but no javap?

I have the JDK 10.0.2 installed, have the cmd opened in the folder of the class files of my program and try the command: javap Simulation.class . I get the error that the command javap is not found. What do I do wrong?
Temerita
  • 101
  • 1
  • 2
  • 7
4
votes
2 answers

How to execute javap from ant

I want to run javap command from an ant script. Javap command is located in the bin folder under JDK, but how do I access the JDK path in an ant script? ${java.home} is pointing to the JRE instead of JDK, so that doesn't help. I'm, looking for a…
msell
  • 2,168
  • 13
  • 30
4
votes
2 answers

In java we can explore a java class, methods by using javap disassembeler. how to do the same in c++?

I'm new to this community so, if I'm violating any t&c of our community by asking this question in wrong section, then I'm sorry. I've been searching answers for the above question for quite a while but none of the results were relevant. I just…
AbhiAbzs
  • 134
  • 2
  • 12
4
votes
3 answers

.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 stumbled across this effect while de-compiling some…
Marged
  • 10,577
  • 10
  • 57
  • 99
4
votes
1 answer

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 constants. Q: can the compiler be told to do just that?…
mgaert
  • 2,338
  • 21
  • 27
1
2
3
8 9