0

I need to debug or better to patch a .jar file which is loading from other Jars / .exe File.

I can decompile the .jar pretty well but it seems to be that Eclipse or IntelliJ need a main function to debug it.

Is there a Way to decompile it change the specific class, recompile all and replace the .class /.java file into the packed jar? A complete compile of all decompiled files from the .jar will not possible i think. There are some "unable to decompile" Marks in other, for me not relevant .class files

guenthernagel
  • 73
  • 1
  • 3
  • 14
  • A jar file is just a zip file, so you can unzip everything into a filesystem tree, patch/modify/replace the class of interest using available tools, create a new filesystem tree, then zip everything up again. It's the "patch/modify/replace" that is complicated, we need to know more. Unless the jar is cryptographically signed or similar. – David Tonhofer Sep 13 '19 at 10:28
  • but for creating a new .jar I need a compiled .class file or not? I got decompiled one now and need to recompile it. – guenthernagel Sep 13 '19 at 10:41
  • Yes, you would compile the source, giving the class file, set up the filetree, then use the "jar" command to create the new jar. – David Tonhofer Sep 13 '19 at 10:44
  • But when i try to compile the tree with Eclipse it looking for a main function. the complete .jar dont have one. – guenthernagel Sep 13 '19 at 10:45
  • You don't want to build an executable. Try this: https://stackoverflow.com/questions/4058155/how-can-i-compile-a-java-program-in-eclipse-without-running-it I have to say it's been some time I haven't used Eclipse. – David Tonhofer Sep 13 '19 at 10:57
  • Exclipse says no build settings av. and i need to choose mainclass for compile it. – guenthernagel Sep 13 '19 at 11:10

0 Answers0