using jar on the windows command prompt, how can I add foo.class to a folder "classes" in foo.jar?
I can add the file to the jar using
jar uvf foo.jar foo.class
but that doesn't put the class in the "classes" folder in the jar.
I know I can use winzip to unzip the jar, add the file, and zip it up again, but that's slow and hopefully unnecessary.
Put foo.class
into a classes
directory, then run
jar uvf foo.jar classes/foo.class
(I've just tried it to make sure it works. There may a way of doing it without creating the classes
directory, but I think this is the simplest solution.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With