Very often the .jar executable files are converted in .exe executable to work with Windows.
First method – Decompile by using JD-GUI
Move the downloaded file in a new folder and change the extension to “.exe” to “.zip”
Open JD-GUI by double clicking the jar executable.
Now open the zip file we just created go to File>Open File…> and choose the file we created
Now you JD-GUI workspace should look like this.
Go To File>Save All Files> and choose the directory when you want to save the zip file with the sources. You should import this file into an IDE to make it work.
Second method – Decompile by using fernflower (via command prompt)
- Rename “Minecraft.exe” in “Minecraft.jar”, with the method used for the JD-GUI to rename it in .zip
- Open the Command Prompt, hitting the button tasto Windows + R, typing cmd and hitting Enter
- Use the cd command to move to the directory the fernflower is in.
-
Now in the Command Prompt write java -jar fernflower.jar Minecraft.jar decomp/
- This will open the fernflower(fernflower.jar), sets the file to decompile to Minecraft.zip and put the decompiled jar in the decomp sub-folder in the fernflower folder.
- Enter the decomp sub-folder in the fernflower folder and rename the “Minecraft.jar” in “Minecraft.zip”
- Now you have your decompiled !
In both cases, you will have to import the decompiled source code into an IDE.
I hope this was useful for your as it was for me! 😀