Appium Doctor - 無法在 MacOS 10.12 上將 $JAVA_HOME/bin 置於 PATH 變量中

2022-09-04 05:12:25

在MacOS 10.12上安装了带有npm的appium doctor,它给了我一个错误:

WARN AppiumDoctor ✖ Bin directory for $JAVA_HOME is not set.

到目前为止,我已经尝试了我所能做的一切,请帮忙。这是我.bash_profile:

export ANDROID_HOME="/Users/sergei/Library/Android/sdk/"
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH
export M2_HOME="/Users/sergei/Desktop/1246702 Sergio/apache-maven-3.3.9"
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
export JYTHON_HOME="/Users/sergei/jython2.7.0/"
export JYTHON=JYTHON_HOME/bin
export PATH=JYTHON:$PATH

export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

答案 1

我需要添加

export PATH=${JAVA_HOME}/bin:$PATH

到 ~/.bash_profile并重新启动终端


答案 2

我从路径中删除了双引号,从末尾删除了斜杠,现在这对我来说很好:

export ANDROID_HOME=/Users/sergei/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH

推荐