How can I add files to a Jar file? (or add a file to a zip archive)

https://stackoverflow.com/questions/12239764/how-can-i-add-files-to-a-jar-file

 

M.java

class M{
    public static void main(String args[]){
        System.out.println("Hello, world!");
    }   
}

 MANIFEST.MF

Manifest-Version: 1.0 
Created-By: 1.8.0_144 (Oracle Corporation)
Main-Class: M

  其实可以接着上一篇文章。。

加入了一个知识点,java  运行jar包。

https://jingyan.baidu.com/article/ff42efa904b4d7c19e220282.html

这个命令,将MANIFEST.MF 这个文件添加到了f.jar 中!!

原文地址:https://www.cnblogs.com/oxspirt/p/7815116.html