How can I open Java .class files in a human-readable way?

后端 未结 17 2088
傲寒
傲寒 2020-11-28 18:09

I\'m trying to figure out what a Java applet\'s class file is doing under the hood. Opening it up with Notepad or Textpad just shows a bunch of gobbledy-gook.

Is the

17条回答
  •  借酒劲吻你
    2020-11-28 18:48

    JAD is an excellent option if you want readable Java code as a result. If you really want to dig into the internals of the .class file format though, you're going to want javap. It's bundled with the JDK and allows you to "decompile" the hexadecimal bytecode into readable ASCII. The language it produces is still bytecode (not anything like Java), but it's fairly readable and extremely instructive.

    Also, if you really want to, you can open up any .class file in a hex editor and read the bytecode directly. The result is identical to using javap.

提交回复
热议问题