I have an older Jar file which I have to modify in order to get it to work. I have already decompiled it with jd-gui and changed the parts that needed change. I would now like to know what I have to do in order to get a jar back? I guess that I have to add the libraries, but there is no extra lib directory.
How do I put everything together?
@Stephen C "Therefore, when you make your changes and recompile, the resulting ".class" file could have unexpected " How exactly is this relevant? I only want the function of the Jar file and not a 1:1 copy of it.
The Jar file is unsigned. What exactly would be the reason to sign a Jar file anyway? If I start it from another program?
If you are asking how to create a JAR:
jartool; see How to create a JAR file from the official Oracle Java tutorials.But it there is no guarantee that what you are doing will actually work. Here are a couple of the problems.
If the original JAR file was signed, you won't be able to re-sign the new JAR ... unless you have the private key that was used when signing.
Decompilation is often inaccurate. There is no guarantee that the Java code that it produces is a correct representation of the original class. Therefore, when you make your changes and recompile, the resulting ".class" file could have unexpected / unwanted differences relative to the original.
I'm not sure what you mean by that. The (new) dependencies of the JAR don't necessarily need to be in the JAR itself. It depends on what kind of JAR it is; e.g. is it a so-called "executable" JAR that you launch using
java -jar my.jar ....