DIGIT-ARC read-only archive · snapshot: July 23, 2026

How to change class files in jar

5 posts · originally from https://geek.digit.in/community/threads/how-to-change-class-files-in-jar.103106/

U
Unbounded Bond Original post #1
Nov 28, 2008 at 5:05 PM
I have a jar file(with all classes), i can decompile it to java file and change according to my requirement , but how can i compile it and include it in my jar.
Please tell me a way to do so.
arpanmukherjee1
Nov 19, 2009 at 7:41 PM
use the javax compile it to .jar.

alternative use java eclipse IDE for automation...
Harinder
Nov 21, 2009 at 5:30 PM
i have a java mobile app as a .jar file i decompiled it, now i wnt to chnge its code and recompile it,,,can u help me out plz.....!!!!!!!!
layzee
layzee #4
Dec 8, 2009 at 8:53 PM
There is unfortunately no perfect decompiler
R
Dec 30, 2009 at 8:22 PM
@Unbounded Bond
Compile it normally as you would do with other java classes. You will get a .class file. Open the jar file with Winzip or 7Zip and replace the previous class file with the new one.

@Harinder
You can also follow the same process as above but normally J2ME apps (if thats what you mean by java mobile apps) are signed using a security certificate. So if you change the class files in the signed jar then it will not be valid and may not run on your mobile.

Let me know if you have any more doubts.