After using IDEA to create a quickstart project through MAVEN and adding Artifacts, it was found that the generated jar package could not be run, and the following error occurred:
Error: Invalid or corrupt jarfile D:\WorkSpace\JavaStudy\*\out\artifacts\*_jar\*.jar
So I tried a lot of methods first, and found that there is no META_INF folder in the jar package at all through comparison, which is the root cause of the jar’s inability to run;
Solutions:
Make sure your MANIFEST.MF is in : src /main/resources/META_INF/ NOT src /main/java/META_INF/
Problem Analysis:
IDEA, when adding artifacts in File\Project Structure\Artifacts\, the default will be to create a directory under src/main/java/META_INF/, but this directory (src/main/java/) has been marked as Sources Root, compile only.
So you should cut src/main/java/META_INF to src/main/resources/META_INF/, src/main/resources/ is Resources Root and will copy to the out directory
Read More:
- [Solved] Git error: inflate: data stream error (invalid block type) error: corrupt loose object
- Android Studio compile error: build tools is corrupt [Solved]
- [Solved] Git error: bad signature 0x00000000 fatal: index file corrupt
- Error:scalac: missing or invalid dependency detected while loading class file ***
- [Solved] Kafka Start Log Error: WARN Found a corrupted index file due to requirement failed: Corrupt index found
- [Solved] Canoe CAPL Error: “the test module is not assigned or invalid”
- [Go] Solve panic: runtime error: invalid memory address or nil pointer dereference in golang
- [Solved] panic: runtime error: invalid memory address or nil pointer dereference
- [Solved] Docker Startup Error: panic: runtime error: invalid memory address or nil pointer dereference
- [Solved] Use the truss console to connect to the public blockchain network error: mnemonic invalid or undefined
- How to Solve pod Error: “Authentication token is invalid or unverified. Either verify it with the email that…”
- [Solved] SyntaxError: Invalid regular expression: invalid group specifier name
- [Solved] Appium Error: InvalidArgumentException: Message: invalid argument: invalid locator
- OpenCV(-206:Bad flag (parameter or structure field)) Unrecognized or unsupported array type [How to Solve]
- [619]libgtk-3.so.0 or libXt.so.6: cannot open shared object file: No such file or directory
- Mybatis error under Springboot project: Invalid bound statement (not found)
- flask init-db Error: Error: Could not locate a Flask application. Use the ‘flask –app’ option, ‘FLASK_APP’ environment variable, or a ‘wsgi.py’ or ‘app.py’ file in the current directory.
- Tensorflow Run Error or the interface is stuck or report error: Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
- [Samtools] Run error: error while loading shared libraries: libcrypto.so.1.0.0 or libncurses.so.5 or libtinfow.so.5
- [Solved] mybatis plus Error: Invalid bound statement (not found)