Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
9
rated 0 times [  9] [ 0]  / answers: 1 / hits: 29066  / 2 Years ago, sat, february 5, 2022, 4:44:55

I have just downloaded the Android Studio and when I try to run ./studio.sh it gives me an error of



'tools.jar' seems to be not in Android Studio classpath. Please ensure JAVA_HOME points to JDK rather than JRE


I have checked /usr/lib/jvm/java-1.7.0-openjdk-amd64 this folder java is there and I have set the environment variables in



/etc/environment


as



JAVA_HOME="/usr/lib/jvm/java-1.7.0-openjdk-amd64/"


but still, the same error is coming, Please help me out,



after saving this file, if I check



echo $JAVA_HOME


nothing comes and when I try



source /etc/environment


it comes as



JAVA_HOME: command not found


How should I proceed?


More From » java

 Answers
7

I got the same error when trying to run the android-studio beta installation. I tried various options, but the one that worked for me was:



sudo apt-get install openjdk-7-jdk 


Didn't have to do anything else.



But, I am surprised that



java -version  


listed the same 3 lines before and after the jdk install:



java version "1.7.0_55"  
OpenJDK Runtime Environment (IcedTea 2.4.7) (7u55-2.4.7-1ubuntu1~0.13.10.1)
OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)


and



echo $JAVA_HOME


outputs blanks, but now the android-studio is running.


[#24262] Sunday, February 6, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kroapathe

Total Points: 445
Total Questions: 117
Total Answers: 99

Location: Botswana
Member since Sun, Sep 19, 2021
3 Years ago
;