我在Mac上有一个shell脚本,它会查找javaw
。即:
#!/bin/sh
javaw -version 2> /dev/null
if [ $? == 0 ]; then
javaw -jar some.jar
else
echo "Java Runtime not installed or JRE executable not in PATH"
fi
但是当我运行它时会出现此错误:
Java Runtime not installed or JRE executable not in PATH
显然,它无法找到javaw
。所以,我的问题是 - Mac OS X上的javaw
[版本10.10.2(14C109)]?
====更新
安装了Java。 e.g:
$ java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
答案 0 :(得分:0)
mac或linux:java -jar xxx.jar &
赢:javaw -jar xxx.jar