This file contains hidden or 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
    
  
  
    
  | Bhavana@Ubuntu:~$ update-alternatives --list java | |
| // Output will be: List of all installed Java versions | |
| // Copy path of Java 7 and add it to PATH variable | |
| Bhavana@Ubuntu:~$ export PATH=/usr/lib/jvm/java-7-openjdk-amd64/jre/bin:$PATH | |
| // Now for this current window, Java version will be 7 | |
| // Open second Terminal | |
| Bhavana@Ubuntu:~$ export PATH=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin:$PATH | |
| // For this second Terminal, Java version will be 8 | 
  
    
      This file contains hidden or 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
    
  
  
    
  | Bhavana@Ubuntu:~$ java -version | |
| openjdk version "1.8.0_171" | |
| OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-2~14.04-b11) | |
| OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode) | |
| Bhavana@Ubuntu:~$ sudo update-alternatives --config java | |
| [sudo] password for Bhavana: | |
| There are 4 choices for the alternative java (providing /usr/bin/java). | |
| Selection Path Priority Status | |
| ------------------------------------------------------------ | 
  
    
      This file contains hidden or 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
    
  
  
    
  | // Suppose default java version is 7 | |
| Bhavana@Ubuntu:~$ java -version | |
| java version "1.7.0_181" | |
| OpenJDK Runtime Environment (IcedTea 2.6.14) (7u181-2.6.14-0ubuntu0.2) | |
| OpenJDK 64-Bit Server VM (build 24.181-b01, mixed mode) | |
| // Now you want to change it to 8. | |
| Bhavana@Ubuntu:~$ sudo nano ~/.bashrc | |
| // It could be bash or bashrc or any other file, as you have set | |
| // in bashrc file; search JAVA_HOME, create if variable doesn't exist | 
  
    
      This file contains hidden or 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
    
  
  
    
  | // Simply show list of installed versions in single line | |
| Bhavana@Ubuntu:~$ update-alternatives --list java | |
| /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java | |
| /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java | |
| /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java | |
| /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java | |
| // To see information like; current default Java version, | |
| // all installed Java versions with there location details, best version etc... | |
| Bhavana@Ubuntu:~$ update-alternatives --display java | 
  
    
      This file contains hidden or 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
    
  
  
    
  | // Install repo | |
| Bhavana@Ubuntu:~$ mkdir ~/bin | |
| Bhavana@Ubuntu:~$ PATH=~/bin:$PATH | |
| Bhavana@Ubuntu:~$ curl https://storage.googleapis.com/git-repo-downloads/repo > repo | |
| Bhavana@Ubuntu:~$ mv repo ~/bin/ | |
| // Install git | |
| Bhavana@Ubuntu:~$ sudo apt-get install git | 
  
    
      This file contains hidden or 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
    
  
  
    
  | $ mkdir nexus5 | |
| $ cd nexus5 | |
| $ repo init -u https://android.googlesource.com/platform/manifest -b android- 6.0.1_r77 | |
| // You might prompt for email authentication, use the following command: | |
| // git config --global user.email "you@domain.com" | |
| // git config --global user.name "FName LName" | |
| $ repo sync | |
| // it will take looooong time…and more bandwidth too | 
  
    
      This file contains hidden or 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
    
  
  
    
  | $ mkdir nexus5_driver | |
| $ cd nexus5_driver | |
| $ wget https://dl.google.com/dl/android/aosp/broadcom-hammerhead-m4b30z-21cf8433.tgz (Copied Link address) | |
| $ wget https://dl.google.com/dl/android/aosp/lge-hammerhead-m4b30z-520d054d.tgz | |
| $ wget https://dl.google.com/dl/android/aosp/qcom-hammerhead-m4b30z-d6c0fe26.tgz | |
| $ ls → You will get three zipped files; feed one by one to below commands | |
| $ tar xvzf broadcom-hammerhead-m4b30z-21cf8433.tgz | |
| $ tar xvzf lge-hammerhead-m4b30z-520d054d.tgz | |
| $ tar xvzf qcom-hammerhead-m4b30z-d6c0fe26.tgz | |
| $ ls → will show you 3 .sh files | 
  
    
      This file contains hidden or 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
    
  
  
    
  | $ cd ~/nexus5 | |
| $ sh /FULL_PATH/nexus5_driver/extract-broadcom-hammerhead.sh | |
| // This will redirect you to licensing page, click enter, enter….at the end you have to type I ACCEPT. Follow for all three .sh files. | |
| $ sh /FULL_PATH/nexus5_driver/extract-lge-hammerhead.sh | |
| $ sh /FULL_PATH/nexus5_driver/extract-qcom-hammerhead.sh | 
  
    
      This file contains hidden or 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
    
  
  
    
  | $ source build/envsetup.sh | |
| $ lunch → aosp_hammerhead-userdebug (Choose as per requirement) | |
| $ make clobber | |
| $ make |