I had installed android studio and jdk8 on Ubuntu. when I open android studio its show me a jdk location error. When I was open the location it shows me /usr/lib/jvm/java-7-openjdk-i386, but I installed jdk8. So how can I set the android studio jdk location to the jdk8 location? I ran echo $JAVA_HOME and it shows me /usr/lib/jvm/java-7-openjdk-i386. I also performed these two commands:

  • java -version: java version "1.8.0_65"
  • javac -version: javac version "1.8.0_65"

So how do I set my jdk location to the jdk8 location?

  • Thanks for updating correct format i will keep in mind before ask any question next time. – Akydev Nov 24 '15 at 6:26

Followning this source.

  • sudo update-alternatives --config java for switch version Javas.
    After switch you should update your JAVA_HOME.
  • sudo nano /etc/environment
    Add your last line or edit JAVA_HOME="YOUR_PATH". With YOUR_PATH you can see from sudo update-alternatives --config java
  • After update JAVA_HOME , run source /etc/environment to finish update.

Anyway this question should mark a duplicate.

  • @Akydev if this is your answer you looking for please mark it done! – BeGood Nov 24 '15 at 10:43
  • I don't know. After perform all this its work but I think there is mismatch of path and now my computer went to the login window loop and I am not able to login. It's redirect me again and again at login window. – Akydev Nov 24 '15 at 11:20
  • i don't think java make you that, please post a question about your loop login – BeGood Nov 24 '15 at 11:28
  • I already posted but there is no solution. I am not able to login from the morning and I am suffering from it and try to find proper solutions. I perform cmd as people told me in the answer. But still same. You can see that at my question. Ubuntu v14.04 login problem ? – Akydev Nov 24 '15 at 11:34
  • Please provide more information about your Question login. Add this line "after I switched my java location via sudo aupdate-alternatives --config java". – BeGood Nov 24 '15 at 11:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.