2017-04-19 70 views
0

從Selendroid的系統要求:如何配置JAVA_HOME爲Selendroid

的Java SDK(最低1.6),必須安裝並配置JAVA_HOME。重要提示:如果JAVA_HOME指向Java運行時環境,selendroid會產生錯誤,因爲像jarsigner這樣的工具不可用!

但是,我的$ JAVA_HOME點:

/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre

我相信這就是爲什麼我不能啓動Selendroid:

... 
Apr 19, 2017 9:14:07 AM io.selendroid.standalone.io.ShellCommand exec 
INFO: Executing shell command: /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre/bin/jarsigner -sigalg MD5withRSA -digestalg SHA1 -signedjar /var/folders/np/gn2yjy916jjg33h2tr3hly3w0000gn/T/resigned-android-driver7285920814303014295.apk -storepass android -keystore /Users/cruz/.android/debug.keystore /var/folders/np/gn2yjy916jjg33h2tr3hly3w0000gn/T/android-driver7285920814303014295.apk androiddebugkey 
Apr 19, 2017 9:14:07 AM io.selendroid.standalone.io.ShellCommand exec 
SEVERE: Error executing command: /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre/bin/jarsigner -sigalg MD5withRSA -digestalg SHA1 -signedjar /var/folders/np/gn2yjy916jjg33h2tr3hly3w0000gn/T/resigned-android-driver7285920814303014295.apk -storepass android -keystore /Users/cruz/.android/debug.keystore /var/folders/np/gn2yjy916jjg33h2tr3hly3w0000gn/T/android-driver7285920814303014295.apk androiddebugkey 
java.io.IOException: Cannot run program "/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre/bin/jarsigner" (in directory "."): error=2, No such file or directory 
... 

我應該設置在哪個路徑我的$JAVA_HOME

(注:我使用的是Mac OS X 10.10.5)

回答

0

所以我終於想通了的路徑,JDK,而不是JRE:

/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home