java - Running a jar file from terminal in ubuntu -


i have jar file , when execute

 java -jar firstjar.jar 

i following errors

error: invalid or corrupt jarfile firstjar.jar

here manifest file

 manifest-version: 1.0  created-by: 1.7.0_79 (oracle corporation)  class-path:mysql-connector-java-5.1.28.jar  main-class:javaapplication1 

contents of jar file

0 wed may 13 14:09:06 ist 2015 meta-inf/ 140 thu may 14 00:26:26 ist 2015 meta-inf/manifest.mf 2917 wed may 13 13:16:02 ist 2015 javaapplication1.class 

thanks in advance!

perhaps jarfile corrupted in way, possibly due how downloaded or installed.

this issue caused manifest file because haven't added space after every colon in here, should be:

manifest-version: 1.0  created-by: 1.7.0_79 (oracle corporation)  class-path: mysql-connector-java-5.1.28.jar  main-class: javaapplication1  

after main-class there must blank line see here https://docs.oracle.com/javase/tutorial/deployment/jar/modman.html.


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -