If you also do not have the source code (either in the JAR or separately), then it is best to use a Java decompiler. Depending on how the code was compiled in the first place, this can generate source code, which is significantly different from what the author wrote (although functionally identical, of course). For example, some optimizer options can overwrite loops and delete local variables. Some debugging options can delete local variable names, so the decompiler will have to invent (meaningless) names for them, etc.
I would also ask if what you want to do is legal. Typically, if a project is licensed for modification, its source code will be available and you will not need to do what you offer.
source share