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

后端 未结 17 1984
傲寒
傲寒 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:55

    You need to use a decompiler. Others have suggested JAD, there are other options, JAD is the best.

    I'll echo the comments that you may lose a bit compared to the original source code. It is going to look especially funny if the code used generics, due to erasure.

    0 讨论(0)
  • 2020-11-28 18:59

    JAD and/or JADclipse Eclipse plugin, for sure.

    0 讨论(0)
  • 2020-11-28 18:59

    If the class file you want to look into is open source, you should not decompile it, but instead attach the source files directly into your IDE. that way, you can just view the code of some library class as if it were your own

    0 讨论(0)
  • 2020-11-28 19:03

    That's compiled code, you'll need to use a decompiler like JAD: http://www.kpdus.com/jad.html

    0 讨论(0)
  • 2020-11-28 19:03

    As suggested you can use JAD to decompile it and view the files. To make it easier to read you can use the JADclipse plugin for eclipse to integrate JAD directly to eclipse or use DJ Java Decompiler which is much easier to use than command line JAD

    0 讨论(0)
  • 2020-11-28 19:03

    CFR - another java decompiler is a great decompiler for modern Java written i Java 6.

    0 讨论(0)
提交回复
热议问题