java.util.zip.ZipException: error in opening zip fileThe literal meaning of this question is that the compression package cannot be opened,
The problem I have here is that the JAR package is corrupted and won’t open.The Linux system can use the command to determine if the JAR is normal:
The problem I have here is that the JAR package is corrupted and won’t open.The Linux system can use the command to determine if the JAR is normal:
jar -vtf xxx.jar
view the jar archive directory
[root@localhost classes]# jar -h
Illegal options: h
Usage: jar {ctxui}[vfmn0PMe] [jar-file] [manifest-file] [entry-point] [-C dir] files ...
Options:
-c create new file
-t List archive directory
-x Extracts specified (or all) files from the archive
-u Update existing archives
-v Generates detailed output from standard output
-f Specify file name of file
-m Contains inventory information from a specified inventory file
-n Execute Pack200 normalization after creating a new profile
-e for standalone applications that are bundled into the executable jar file
Specifying application entry points
-0 Storage only; does not use any ZIP compression
-P Preserves leading '/' (absolute path) and "..." (parent directory) components in filenames (parent directory) components
-M Inventory file without creating entries
-i generates index information for a specified jar file
-C changes to the specified directory and contains the following files
If any file is a directory, it is recursively processed.
Specify the order of the list file name, file name and entry point name.
in the same order as the 'm', 'f' and 'e' tags are specified.
Example 1: Archiving two class files into a file called classes.jar:
jar cvf classes.jar Foo.class Bar.class
Example 2: Using an existing manifest file 'mymanifest' and the
Archive all files from the foo/ directory into 'classes.jar':
jar cvfm classes.jar mymanifest -C foo/ .
if it can be opened, it means it is normal; if it cannot be opened, it means the jar package is damaged:
The following error occurs:
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:220)
at java.util.zip.ZipFile.<init>(ZipFile.java:150)
at java.util.jar.JarFile.<init>(JarFile.java:166)
at java.util.jar.JarFile.<init>(JarFile.java:130
The solution is to switch to a usable jar. If the jar isn’t working because of maven’s packaging, check out the blog: click the open link
Follow WeChat: community of programmers and developers
Read More:
- [Solved] Maven Project Error: error in opening zip file
- [Solved] Scala error: type mismatch; found : java.util.List[?0] required: java.util.List[B]
- Solve the use of declaration transactions in spring java.lang.NoClassDefFoundError: org/aspectj/util/PartialOrder$PartialComparable
- [Solved] Java.lang.ClassCastException: [Ljava.lang.Long; cannot be cast to java.util.List
- [How to Solve Error]java.util.Date cannot be cast to java.sql.Date
- [Solved] Failed to instantiate java.util.List using constructor NO_CONSTRUCTOR with arguments
- [Solved] Java.util.linkedhashmap cannot be cast to entity class
- [Solved] Failed to convert value of type ‘java.lang.String‘ to required type ‘java.util.Date‘;
- [Solved] Hadoop Error: Exception in thread “main“ java.io.IOException: Error opening job jar: /usr/local/hadoop-2.
- [Solved] Kafka in Windows error:java. nio. file. Filesystemexception: this file is in use by another program and cannot be accessed by the process
- [Solved] JSON parse error: Cannot deserialize instance of `java.util.ArrayList<..> out of START_OBJECT token;
- kakfa Create topic Error: java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.InvalidReplicationFactorException: Replication factor: 3 larger than available brokers: 2.
- [Solved] java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
- Android solution Java.util.concurrent.ExecutionException: com.Android.ide.common.process.ProcessException: exception
- How to Fix Error Caused by: java.util.MissingResourceException: Can‘t find bundle for base name xxx, locale zh_CN
- Android studio compilation failed: java.util.concurrent.ExecutionException: com.android.ide.common.process.Process
- Java error: unable to find or load main class (package name in source file)
- [Solved] Docker Elasticsearch8.4.0 Error: Exception in thread “main” java.nio.file.FileSystemException
- [Solved] tomcat Startup Error: java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
- [Solved] java: Internal error in the mapping processor: java.lang.NullPointerException