java -jar命令

java -jar jarname.jar args

 

jar里面修改META-INF/MANIFEST.MF 文件如下红色部分:

 

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.5.2
Created-By: 1.2.2 (Sun Microsystems Inc.)
Class-Path: .
Main-Class:classpath/classname

 

示例:

    public static void main(String[] args)
    {
        if (null != args && args.length > 0)
        {
            System.out.println(args[0]);
            XMLProcessManager xpm = new XMLProcessManager();
            xpm.process(args[0]);
        }
        else
        {
            return;
        }  
    }

 

 

你可能感兴趣的:(java,apache,ant,sun)