-1

I'm trying to set up JAVA_CMD_HOME on a Mac (iOS 10.9) for the mTurks CLI. After I set my access keys, I've run the following in the Terminal

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

When I run:

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

I get the following error:

/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

How do I set this directory?

User7598
  • 1,658
  • 1
  • 15
  • 28
  • I believe you are asking for `JAVA_HOME` instead of `JAVA_CMD_HOME`? Have a look in http://stackoverflow.com/questions/1348842/what-should-i-set-java-home-to-on-osx – Adrian Shum Feb 16 '15 at 02:28

1 Answers1

2

Use this to find the system java installs:

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

so in your script / .bash_rc file:

$ export JAVA_HOME=$(/usr/libexec/java_home)
stringy05
  • 6,511
  • 32
  • 38
  • When I change the file path, I get: `log4j:ERROR setFile(null,true) call failed. java.io.FileNotFoundException: ../log/aws-mturk-clt.log (No such file or directory)log4j:ERROR setFile(null,true) call failed. java.io.FileNotFoundException: ../log/aws-mturk-clt.log (No such file or directory)` and `There was a problem reading your properties file from mturk.properties.The exception was java.io.FileNotFoundException: mturk.properties (No such file or directory) Exception in thread "main" java.lang.RuntimeException: Cannot load configuration properties file from mturk.properties` – User7598 Feb 16 '15 at 02:43
  • that's great! Java is now working, plz accept the answer :). Also put your properties files in the correct directories – stringy05 Feb 16 '15 at 02:47
  • I've added a new [question](http://stackoverflow.com/questions/28534369/specify-cli-path-for-mturk-for-mac). Please help if you can. – User7598 Feb 16 '15 at 15:58