I'm trying to view the bytecode of my class but doesn't find the class even though the .class
file is there. I can compile the Main.java
file just fine from the CLI but when using javap -c Main
it doesn't find the class.
public class Main {
public static void main(String args[]) {
int Y = 0;
int X = (Y + 4) * 3;
}
}
If the class is in the default package, and if you are in the directory where the Main.class file is, the use
javap -cp . -c Main
If your class is in the package com.foo.bar, then go th the directory where the Main.class file is (bar), then execute the following commands:
bar> cd ..
foo> cd ..
com> cd ..
> javap -cp . com.foo.bar.Main
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With