I was setting up android studio and got this
So I followed the answer here and used
sudo update-alternatives --set java /usr/local/java/jdk1.7.0_17/jre/bin/java
sudo update-alternatives --set javaws /usr/local/java/jdk1.7.0_17/jre/bin/javaws
But this gave me update-alternatives: error: alternative /usr/local/java/jdk1.7.0_17/jre/bin/java for java not registered; not setting
How can I fix this and get android studio working? I am have openJDK installed.
Best Answer
Most likely the exact 1.7.17 version is different now and the
jdk1.7.0_17
does not exists, so use the interactive command to change thejava
orjavaws
alternative.It's a lot less likely to make mistakes with this. :)