为MAC设置JAVA_CMD_HOME

时间:2015-02-16 02:05:12

标签: java mechanicalturk

我正在尝试在Mac(iOS 10.9)上为mTurks CLI设置JAVA_CMD_HOME。设置访问密钥后,我在终端

中运行以下命令
export MTURK_CMD_HOME=/users/Desktop/aws-mturk-clt-1.3.1/
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/Current
export PATH=$PATH:/users/Desktop/aws-mturk-clt-1.3.1/bin

当我跑步时:

/users/Desktop/aws-mturk-clt-1.3.1/bin/getBalance.sh

我收到以下错误:

/users/Desktop/aws-mturk-clt-1.3.1//bin/invoke.sh: line 79: /System/Library/Frameworks/JavaVM.framework/Versions/Current/bin/java: No such file or directory

如何设置此目录?

1 个答案:

答案 0 :(得分:2)

使用它来查找系统java安装:

$ /usr/libexec/java_home
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home

所以在你的脚本/ .bash_rc文件中:

$ export JAVA_HOME=$(/usr/libexec/java_home)