Appium Doctor - Failed to set $ JAVA_HOME / bin to PATH variable on MacOS 10.12

Installed appium doctor with npm on macOS 10.12 and it gives me one error:

WARN AppiumDoctor βœ– Bin directory for $JAVA_HOME is not set. 

I tried everything I could, so far, please help. Here is my .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 
+8
source share
8 answers

I removed double quotes from paths and slashes from the end. Now this works fine:

 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 
+10
source

I needed to add

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

to ~ / .bash_profile and restart the terminal

+11
source

It looks like an old post, but for future viewers I found this solution better because of this it does not hardcode the java sdk path.

 JAVA_HOME=$(/usr/libexec/java_home) export PATH=${JAVA_HOME}/bin:$PATH 
+4
source

I made a mistake rookie and I want to add it here so that people do not repeat my mistake.

Instead of exporting $ PATH and $ JAVA_HOME, I used it from the / etc / environment file. As a result, both seemed correct when I use the echo, but my Appium installation could not find it.

Then I found this: Unix: What is the difference between source and export?

Basically, you should export variables from your bashrc so that they are added to your global environment, and appium will be able to access it.

+1
source

Many correct answers should work for someone, not some.

I recommend trying the solution from official developer support.

 JAVA_HOME=/usr/java/j2sdk1.5.0 export JAVA_HOME PATH=$JAVA_HOME/bin:$PATH; export PATH 

try it should work like a charm. [ https://docs.oracle.com/cd/E19575-01/820-5019/ghhls/index.html{[1]

+1
source

My problem was that I forgot to close the terminal and restart it. When you finish adding JAVA_HOME/Bin to PATH in your environment variables, click OK and close and remember to close all of your terminals as well.

After re-opening your terminal, it should be updated, and running appium-doctor will see the updated environment variable.

+1
source

I tried different things, everything was fine, but this file "Bin $ JAVA_HOME directory is not installed" remained. After that, I wrote npm uninstall appium-doctor in bash, and after that everything was fine ... you can try uninstalling, then npm install appium-doctor

0
source
 export JAVA_HOME=$(/usr/libexec/java_home) export PATH=${JAVA_HOME}/bin:$PATH 
0
source

Source: https://habr.com/ru/post/1258735/


All Articles