0

My friend asked me if I can make some changes to pluggins he send me. I tried googeling them to find the sorcecode somewhere. Sadly it seems that they are not open scource.

So I started decompiling the jar(s) and made the changes in the .class files with IntelliJ. Now is my question how I can compile it back to a .jar file. Normaly I used maven to build the plugins. But because it isn't a maven project this doesn't work.

I tried creating the jar with:

jar cvf plugin.jar .

but this gives me the error Cannot find main class

Colors
  • 1
  • If you're able to compile a single file into a .class file, you could simply open the jar as a zip using something like 7zip and replace the existing .class file with yours. If you're wanting to be able to edit the project as a whole, your only option would be to decompile it, save the decompiled code to a folder, then create a build configuration and fix any compilation errors. I've done the second option before with success, but the larger and more complicated the project is, the harder and more time consuming it is to get it to build. – Jesse Dec 20 '22 at 20:54
  • @Jesse I decompiled the jar to a folder, forgot to mention that. And my main problem is to build the jar. – Colors Dec 20 '22 at 20:59
  • Right. You'll have to fix the compiler errors like I mentioned. Decompiling is not exact and very often results in code that can't be re-compiled. – Jesse Dec 20 '22 at 21:06

0 Answers0