java 如何使用shell脚本执行java代码?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12756556/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 10:05:17 来源:igfitidea点击:
How to execute java code using shell script?
提问by Sai Ye Yan Naing Aye
Possible duplicate "How to run Unix shell script from Java code?".
可能重复“如何从 Java 代码运行 Unix shell 脚本?”。
I would like to know how to execute java code using shell script?
我想知道如何使用shell脚本执行java代码?
I want to know is :
我想知道的是:
shell script executes java code.
I don't want to know is
我不想知道是
java code executes shell script.
- My OS version is
cent0s 5.5 (64-bit)
.
- 我的操作系统版本是
cent0s 5.5 (64-bit)
.
回答by Tom
As in, like this you mean?
就像这样,你的意思是这样?
#!/bin/sh
java -jar your-java-compiled-into-a.jar