Java : javap ERROR:Could not find .class

mcacorner picture mcacorner · Nov 13, 2012 · Viewed 12.7k times · Source

In my system(Ubuntu 10.04) java is running fine but I am not able to run javap command
I have complile Foo class and .class file path is locate at
/home/mahesh/java/opt
when I execute
javap -c Foo.class
I get following error message :
ERROR:Could not find Foo.class
Is there any need to set any environment variable or any thing else to resolve it. my $PATH variable is target to:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/bin/
Thank you.

Answer

mkhelif picture mkhelif · Nov 13, 2012

You just need to remove the .class extension.

Use the following command: javap -c Foo