Altering .class file within existing .jar plugin


#1

I am trying to change one .class file in a .jar package. I am changing the .java text and then compiling, but if I do this through terminal or through Eclipse, I get compiler errors (seemingly because the compiler does not recognize some ImageJ specific code). What is the best way for me to change one .class file within a .jar. My current methods of using javac or compilers are not working.

After successfully altering the .class file, can I simply compress the package as a .zip then change the extension to .jar, or do I need to perform additional commands? Classpaths should remain the same, as I am not changing the names of any of the files. Thanks!


#2

Welcome to the forum, @DavidK!

Which plugin are you trying to edit? Is its source code organized in a Maven project?

The recommended way to contribute to existing plugins is outlined on the wiki page How to contribute to an existing plugin or library.


After editing the java code, building the jar file should be as easy as running

mvn

from the command line, provided the plugin is a well-structured Maven project.