Search code examples
javadecompilerjavap

Trying to decompile a java .class file with javap.exe


I have some .class files that I want to decompile. So this is what I do: javap -c "C:\users\Richard\workspace\pruebas\bin\ClassName" and all the time I have the same error ERROR:Could not find C:\users\Richard\workspace\pruebas\bin\ClassName

However, if I list the files contained in such directory using the dir command I can see it listed.

Do you guys have any idea of what might be the cause? I did man javap and as far as I know the syntax is correct.

Any idea is greatly appreciated.


Solution

  • javap looks for classes in the classpath. So, assuming that your ClassName is in the default package, invoke like this:

    javap -c -classpath "C:\users\Richard\workspace\pruebas\bin" ClassName