且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用命令行参数执行 jar

更新时间:2023-02-22 11:15:18

在命令 shell 中试试这个:

Try this in the command shell:

java -cp your-classpath-dependencies-here -jar hello.jar "arg1" "arg2"

在 Ant 中使用 内置任务执行此操作:

Do it in Ant with the <java> built-in task:

http://ant.apache.org/manual/Tasks/java.html