Last active
August 29, 2015 14:09
-
-
Save glm-mawla/c36468845ab56f8ca344 to your computer and use it in GitHub Desktop.
From http://stackoverflow.com/questions/6477415/how-to-set-oracles-java-as-the-default-java-in-ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extract the files you just downloaded in that directory: | |
$ sudo tar xvzf jdk-8u5-linux-i586.tar.gz -C /usr/java | |
***[if folder notfound (/usr/java) then Command: sudo mkdir /usr/java] | |
now to set your JAVA_HOME environment variable: | |
$ export JAVA_HOME=/usr/java/jdk1.8.0_05/ | |
$ sudo update-alternatives --install /usr/bin/java java ${JAVA_HOME%*/}/bin/java 20000 | |
$ sudo update-alternatives --install /usr/bin/javac javac ${JAVA_HOME%*/}/bin/javac 20000 | |
make sure the Oracle's java is set as default java by: | |
$ sudo update-alternatives --config java | |
you get something like this: | |
There is only one alternative in link group java (providing /usr/bin/java): /usr/java/jdk1.8.0_25/bin/java | |
Nothing to configure. | |
Or, | |
There are 2 choices for the alternative java (providing /usr/bin/java). | |
Selection Path Priority Status | |
------------------------------------------------------------ | |
* 0 /opt/java/jdk1.8.0_05/bin/java 20000 auto mode | |
1 /opt/java/jdk1.8.0_05/bin/java 20000 manual mode | |
2 /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java 1061 manual mode | |
Press enter to keep the current choice[*], or type selection number: | |
$ java -version | |
if you get something like the following, you are good to go: | |
java version "1.8.0_05" | |
Java(TM) SE Runtime Environment (build 1.8.0_05-b13) | |
Java HotSpot(TM) Server VM (build 25.5-b02, mixed mode) | |
Got it on Ubuntu 14.04LTE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
extract android studio file
goto extracted directory and /bin directory (i.e. android-studio/bin)
then in terminal run command:
$ ./studio.sh