Executable jar & java -jar

1, create a maven project, write java file that contains the main method

2、File-->Project Structure-->Artifacts

3、

4、

  Note that the red line marked part here: the MANIFEST.MF must choose to resource the following, rather than directly on the inside src

  Note facie generated jar package storage directory

5、

  The prompt indicates that the generated MANIFEST.MF file inside the Main-Class is not content, then you need to re-confirm whether the file in the resource directory

6、

  Successful implementation !!!

 

Guess you like

Origin www.cnblogs.com/dog-fan/p/11285758.html