Robot Framework – Appium Do Not See Java_Home

first time When I do all the settings and i run appium-doctor it passes, but next time I restart my macbook and run again.I received these message error not see

My Error :

`WARN AppiumDoctor ✖ ANDROID_HOME is NOT set!

WARN AppiumDoctor ✖ JAVA_HOME is NOT set!

WARN AppiumDoctor ✖ adb could not be found because ANDROID_HOME is NOT set!

WARN AppiumDoctor ✖ android could not be found because ANDROID_HOME is NOT set!

WARN AppiumDoctor ✖ emulator could not be found because ANDROID_HOME is NOT set`

I don’t know why it is like this. Please help me fix it T____________T

Answer

That’s because your shell profile cant read ANDROID_HOME and JAVA_HOME on a fresh start. You have 2 options,

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=${PATH}:${JAVA_HOME}/bin
export ANDROID_HOME=/home/user_name/Android/Sdk

Either use the export command on each shell opening

OR

add ANDROID_HOME and JAVA_HOME to your profile, which depends on your profile. each shell has its own RC file, like .bashrc, .zshrc.

Recommending the second one