java -jar 传递参数

在打jar包时至指定在Manifest里只指定一个主类,与shell命令行传递参数有关

当项目中有两个public 类
org.example.HiveServerTestJDBC
org.example.MetastoreTestConcurrent
Manifest文件中指定一个主类Main-Class: org.example.HiveServerTestJDBC
通过shell脚本传进来的参数,只会传到org.example.HiveServerTestJDBC的main方法中
即使用java -jar /home/service/app/pt-hms.jar org.example.MetastoreTestConcurrent +参数参数也会传到org.example.MetastoreTestConcurrent的main方法里

原文地址:https://www.cnblogs.com/DemonQin/p/15273269.html