Step 1. Installed java on my WSL by running
sudo apt install default-jdk
when I run java –version it gives me openjdk 11.0.18 2023-01-17
Step 2. Installed VcXsrv X Server on my Windows 10. Configured it so I’m sure that it works (I mananged to start Ubuntu’s calculator on it by running "xcalc" in the terminal)
Step 3. Downloaded Android Studio linux package and unzipped it in my home directory subfolder.
Now I am trying to start it by running "sh studio.sh" but an error from VcXsrv X Server is popping out:
Cannot start Android Studio: No JRE found. Please make sure
$STUDIO_JDK, $JDK_HOME, or $JAVA_HOME point to valid JRE installation.
What am I supposed to do? Does it need me to install JDK on Windows as well and set env variables there?
2
Answers
Running java binary does not tell you about JAVA_HOME variable. Run echo $JAVA_HOME to see if its present, if not check here how to set it: How to set JAVA_HOME in Linux for all users
I was in the same position for weeks, but I managed to get round it by downgrading Studio to version 2021.1.1
And downgrading java to version 11 by running
sudo apt install openjdk-11-jre
. Check this out for further info on how and when to do this.My next steps is to find out which is the latest version of each that I can use without breaking what now works.