r/javahelp • • Jul 09 '21

Unsolved .class file help

Heyo, does anyone know how to open a .class file so I can read the code inside?

0 Upvotes

6 comments sorted by

View all comments

3

u/morhp Professional Developer Jul 09 '21

.class files contain compiled byte code and not Java source code, but good IDEs will give you the option to decompile it if you open them. So just open for example Intellij IDEA, drag the class file into it, and it should show you the decompiled result (or the raw byte code if you want).

(You may need to set up a JDK and similar stuff before)