I have a sample.ear file and I want to replace a particular file inside sample.ear.
consider ear file sample.ear which content com1/test1/file1.sh and com2/file2.sh
here I want to replace file1.sh with updated file file1.sh using unix.
I am using jar command but i am not able to replace the file in subdirectories
Thanks
The Jar tool provides a u option which you can use to update the contents of an existing JAR file by modifying its manifest or by adding files. In this command: The u option indicates that you want to update an existing JAR file. The f option indicates that the JAR file to update is specified on the command line.
Use:
jar -xf sample.ear com1/test1/file1.sh
to extract file.sh
. Once you are done modifying this com1/test1/file1.sh
file use:
jar -uf sample.ear com1/test1/file1.sh
to update the archived ear with the modified file.
Use jar --help
for detailed help.
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