문제

I'm trying to port a wikimedia plugin to run on OpenVMS and needed to alter a class. I'm trying to update the .class file in the jar using jar uf jar-file .class-file, however when I do this I get the following:

java.util.zip.ZipException: duplicate entry: META-INF/LICENSE.txt
        at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:175)
        at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:90)
        at sun.tools.jar.Main.update(Main.java:507)
        at sun.tools.jar.Main.run(Main.java:184)

It turns out there are 2 LICENSE.txt files in the jar and I can't seem to get rid of them.

Any ideas on how to just get the new .class file into the jar or how to get rid of the duplicate file?

도움이 되었습니까?

해결책

A jar file is just a zip, so unzip the JAR and then re-package it. Or open it with any graphical zip file utility and remove the duplicate entry.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top