好好爱自己!

How to make an executable jar file?

https://stackoverflow.com/questions/5258159/how-to-make-an-executable-jar-file

文件的路径如下:

 

package com.tellidea;

public class Temp{
    public static void main(String args[]){
        System.out.println(args[0]);
    }
}

 

 直接vim myjar.jar 打开jar包,查看里面的内容:

MANIFEST.MF文件的内容:

 

 

 

---------------------------------------------------------------

Here it is in one line:

jar cvfe myjar.jar package.MainClass *.class

where MainClass is the class with your main method, and package is MainClass's package.

Note you have to compile your .java files to .class files before doing this.

posted @ 2018-07-27 14:29  立志做一个好的程序员  阅读(593)  评论(0编辑  收藏  举报

不断学习创作,与自己快乐相处