像 shell一样执行 jar
通常执行 java -jar helloworld.jar
可是看到 kettle 执行时候 ./spoon 或者 presto客户端 执行时候 ./presto
执行很间洁,怎么做到的?
一.新建 stub.sh
二. 将脚本和 jar 合并,并赋予权限
- cat stub.sh helloworld.jar > helloworld && chmod +x helloworld
三. 执行
- ./helloworld
参考文章: https://coderwall.com/p/ssuaxa/how-to-make-a-jar-file-linux-executable