如何执行命令行参数的jar [英] How to execute jar with command line arguments
问题描述
可能重复:结果
<一href=\"http://stackoverflow.com/questions/5536476/passing-arguments-to-jar-which-is-required-by-java-inter$p$pter\">Passing参数JAR这是由Java的跨preTER 要求
如何提供的命令行输入到一个文件,该文件是在一个罐子
我有一个jar文件hello.jar有一些人说,我想从命令行参数有两个执行execute.java文件,我怎么能achive此
我有一个清单文件,并使用蚂蚁提到executable.java作为主类
我必须要逃避蚂蚁运行此文件命令行参数
how to provide command line input to a file which is in a jar I have a jar file hello.jar with some say execute.java file which i want to execute from command line with two arguments;how can i achive this i have mentioned a executable.java as a main class in a manifest file and using ant i have to run this file from ant run with command line arguments
感谢和问候
samarth
Thanks and Regards samarth
推荐答案
在命令shell试试这个:
Try this in the command shell:
java -cp your-classpath-dependencies-here -jar hello.jar "arg1" "arg2"
与做在蚂蚁的&LT;&Java的GT;
内置的任务:
<一个href=\"http://ant.apache.org/manual/Tasks/java.html\">http://ant.apache.org/manual/Tasks/java.html
这篇关于如何执行命令行参数的jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!