简体   繁体   中英

When executing JAR, I get Java program completed with exit code 1

I have a java classfile which has 'Hello World'. I have created JAR file and Manifest file. When I do a RUNJVA command with Classfile it works fine. But when I try to use JAR file in RUNJVA, I don't see any output after the call. Classpath is set properly. I Just get 'Java program completed with exit code 1'

Thanks in Advance.

确保您的 jar 文件中有一个META-INF/MANIFEST.MF文件,其中至少包含类似Main-Class: full.qualified.name.of.MyClass ,并以java -cp {my-classpath-here} -jar myjarfile.jar开头java -cp {my-classpath-here} -jar myjarfile.jar

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM