I use Intelli J IDE to build one executable JAR which contains all dependencies and test classes.
the /src/main/java/META-INF/MANIFEST.MF is
Manifest-Version: 1.0 Main-Class: org.testng.TestNG
When I run the jar with the command
java -jar tahoe-test.jar org.testng.TestNG suites/t123.xml
I get error:
Error: Invalid or corrupt jarfile tahoe-test.jar
If I unzip the jar and then run the command
java org.testng.TestNG suites/t123.xml
all works fine! Why cant I run the jar?
尝试运行:
java -cp tahoe-test.jar org.testng.TestNG suites/t123.xml
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.