How to view code of java class file
Java class file (.class) is the compiled version of java program (.java) it’s also known as byte code it can be executed by the JVM (java virtual machine). You cannot understand the byte code because its compiled form of java program so you need to decompile first then you read.
How to decompile the java class file
- First you have to download the java de-compiler (you may download from here jad tool ).
- Now set the path of this java de-compiler or paste it into the bin folder. C:\Program Files\Java\jdk1.8.0_05\bin
- Suppose we have First.class file in C:\java program folder.
- Open cmd and go to the class file location.
- Type jad First.class
- After that you can see the file First.jad in the same folder.
- Right click on that file and open with notepad.