unjar

How to delete a specific File/Folder from a jar pragmatically in java

生来就可爱ヽ(ⅴ<●) 提交于 2021-01-22 08:01:40
问题 How to delete a specific File/Folder from a jar pragmatically in java. I have a jar ABC.jar contains files, folder and another jars say child.jar. under child.jar I want to delete a specific file. How can I do? so that my ABC.jar structure remains same. Any help will be appreciate. Thanks in Advance. 回答1: As answered by @icza we have to iterate through original jar file and deleting the entry we don't want. Here is the java code you can refer. public static void main(String[] args) throws

How to delete a specific File/Folder from a jar pragmatically in java

孤者浪人 提交于 2021-01-22 08:01:03
问题 How to delete a specific File/Folder from a jar pragmatically in java. I have a jar ABC.jar contains files, folder and another jars say child.jar. under child.jar I want to delete a specific file. How can I do? so that my ABC.jar structure remains same. Any help will be appreciate. Thanks in Advance. 回答1: As answered by @icza we have to iterate through original jar file and deleting the entry we don't want. Here is the java code you can refer. public static void main(String[] args) throws

How do you use ant to unjar multiple JAR files and rebuild them into one JAR file?

好久不见. 提交于 2019-11-30 00:38:13
问题 I would like to unjar multiple JAR files and then rebuild into one JAR using an ant build script. Is this possible? 回答1: Yes, it's possible with ant. A jar file is basically a zip with a special manifest file. So to unjar, we need to unzip the jars. Ant includes an unzip task. To unzip/unjar all the jar files in your project: <target name="unjar_dependencies" depends="clean"> <unzip dest="${build.dir}"> <fileset dir="${lib.dir}"> <include name="**/*.jar" /> </fileset> </unzip> </target>