title: Android 5.0 build errors with Java version issue
body: <p>My current java version running on my Ubuntu 14.04 is</p>
  
  <pre><code>java -version
  java version "1.7.0_72"
  Java(TM) SE Runtime Environment (build 1.7.0_72-b14)
  Java HotSpot(TM) 64-Bit Server VM (build 24.72-b04, mixed mode)
  </code></pre>
  
  <p>I've typed the command to change the java version</p>
  
  <pre><code>sudo update-alternatives --config java
  There are 2 choices for the alternative java (providing /usr/bin/java).
  
    Selection    Path                                            Priority   Status
    ------------------------------------------------------------
    0            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      auto mode
  * 1            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      manual mode
    2            /usr/lib/jvm/java-7-oracle/jre/bin/java          1         manual mode
  
  Press enter to keep the current choice[*], or type selection number: 1
  test@test-ZX-530:/media/test/SSD/N7$ sudo update-alternatives --config javac
  There are 2 choices for the alternative javac (providing /usr/bin/javac).
  
    Selection    Path                                         Priority   Status
    ------------------------------------------------------------
    0            /usr/lib/jvm/java-7-openjdk-amd64/bin/javac   1071      auto mode
  * 1            /usr/lib/jvm/java-7-openjdk-amd64/bin/javac   1071      manual mode
    2            /usr/lib/jvm/java-7-oracle/bin/javac          1         manual mode
  
  Press enter to keep the current choice[*], or type selection number: 1
  </code></pre>
  
  <p>After configuring this, the java -version does not change.</p>
  
  <p>When I tried to build Android 5.0, the error occured and shown the following error message:</p>
  
  <pre><code>============================================
  Checking build tools versions...
  ************************************************************
  You asked for an OpenJDK 7 build but your version is
  java version "1.7.0_72" Java(TM) SE Runtime Environment (build 1.7.0_72-b14) Java     HotSpot(TM) 64-Bit Server VM (build 24.72-b04, mixed mode).
  ************************************************************
  build/core/main.mk:191: *** stop. Stop.
  
  #### make failed to build some targets  ####
  </code></pre>
  
  <p>Any idea to this? Thanks!</p>
  
  <p>==================================================================================</p>
  
  <p>I have found out the question to this issue.</p>
  
  <p>The java version is Openjdk when I run</p>
  
  <pre><code>. build/envsetup.sh
  </code></pre>
  
  <p>However, when I run</p>
  
  <pre><code>lunch aosp_flo-userdebug
  </code></pre>
  
  <p>The java version switch back to Java SE.</p>
  
  <p>Please let me know if you may have any idea</p>
  
  <p>Thanks</p>
  
  <p>===========================================================================</p>
  
  <p>Hi,</p>
  
  <pre><code>lunch aosp_flo-userdebug
  </code></pre>
  
  <p>I thihk this command checks my configuration and switches back to Java SE jdk version.</p>
  
  <p>After running this command and exporting my OpenJDK path again make the build work.</p>