title: building android error java version
body: <p>I'm newbie in building android OS.</p>
  
  <p>I use Ubuntu 14.04 LTS  and the JDK 8.</p>
  
  <p>The envsetup.sh gives :</p>
  
  <pre><code>============================================
  PLATFORM_VERSION_CODENAME=REL
  PLATFORM_VERSION=6.0.1
  TARGET_PRODUCT=aosp_arm
  TARGET_BUILD_VARIANT=eng
  TARGET_BUILD_TYPE=release
  TARGET_BUILD_APPS=
  TARGET_ARCH=arm
  TARGET_ARCH_VARIANT=armv7-a
  TARGET_CPU_VARIANT=generic
  TARGET_2ND_ARCH=
  TARGET_2ND_ARCH_VARIANT=
  TARGET_2ND_CPU_VARIANT=
  HOST_ARCH=x86_64
  HOST_2ND_ARCH=x86
  HOST_OS=linux
  HOST_OS_EXTRA=Linux-3.13.0-85-generic-x86_64-with-Ubuntu-14.04-trusty
  HOST_CROSS_OS=windows
  HOST_CROSS_ARCH=x86
  HOST_CROSS_2ND_ARCH=x86_64
  HOST_BUILD_TYPE=release
  BUILD_ID=MASTER
  OUT_DIR=out
  ============================================
  </code></pre>
  
  <p>And I try to compile with <strong><em>make -J4</em></strong></p>
  
  <p>I get the foolowing error :</p>
  
  <pre><code>============================================
  You asked for an OpenJDK 7 build but your version is
  java version "1.8.0_92" Java(TM) SE Runtime Environment (build 1.8.0_92-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode).
  ************************************************************
  build/core/main.mk:220: *** stop.
  make: *** [out/build-aosp_arm.ninja] Erreur 1
  ============================================
  </code></pre>
  
  <p>So I change the JDK to version 7 but I get the same error but inverted :</p>
  
  <pre><code>============================================
  You asked for an OpenJDK 8 build but your version is
  java version "1.7.x" Java(TM) SE Runtime Environment (build 1.7.x) Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode).
  ************************************************************
  </code></pre>
  
  <p>So what is the pb ?</p>
  
  <p>How can I solve it ?</p>
  
  <p>Thank for your help</p>