|
Java™ by example!
|
|
|
How do I decompile JDK 1.5 classes?
jad expects class file versions (major.minor) to be 45.3 or 46.0. Sources compiled with 1.5 have the file version 48.0. The following error message is displayed when trying to decompile a 1.5 .class file:
To be able to use JAD, we can simply change the class file version of a 1.5 compiled class into 46. The following small application sets the magic number of a .class file or all classes in a jar file to whatever you desire. ChangeMagicNumber.java:
For example:
Now the decompilation of the following 1.5 enum-example source works fine, after changing its file class version to 46. Main.java:
Execute:
results in: DestinationType.jad:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|