How to set JAVA_HOME configuration on Appium Desktop on Mac?

I’ve been testing on both ios and android for a time now. Yesterday appium desktop asked me to update to the latest version and so I did. After updating to 1.17.1 none of my tests worked. I spent so much time to find a solution and finally managed to make my ios tests work. But my android tests still doesn’t work. I think it is about JAVA_HOME configuration. Here are the logs:
appium-server-logs copy.txt (14.4 KB)

Looks like java was not found. Make sure Java is installed properly or not and Android studio as well. Try to uninstal and install it again. Please make sure to keep the environment varaible as follows in .bash_profile or .bashrc file.

#JAVA_HOME
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home
PATH="/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home/bin:$PATH}"

#ANDROID_HOME
export ANDROID_HOME=/Users/xxxxx/Library/Android/sdk
PATH="/users/xxxxx/Library/Android/sdk/tools:${PATH}"
PATH="/Users/xxxxx/Library/Android/sdk/tools/bin:$PATH}"
PATH="/Users/xxxxx/Library/Android/sdk/platform-tools:${PATH}"

Set automationName=UiAutomator2 in your desired capabilities as well.

Thank you for the fast reply. I re-installed Java even though I was sure it was installed and changed the JAVA_HOME in my .bash_profile to what you wrote. And it still gave me the same error. I typed source ~/.bash_profile but it still used the configurations on the appium desktop even though I was trying to run from terminal. And appium desktop was putting /bin/java at the end of whatever I was typing in the JAVA_HOME configuration for some reason. So I only wrote usr to the JAVA_HOME configuration in the appium desktop app. And it worked!

Hi, I have a similiar issue, but I don’t understand what would yo to say with " So I only wrote usr to the JAVA_HOME configuration in the appium desktop app". How yo configure it on Desktop app?

I meant that in the Appium desktop application’s configurations panel I wrote like this:

22

Okey, thanks! That helps me