2016-04-27 54 views
3

我是建立android操作系統的新手。建設android錯誤java版

我使用Ubuntu 14.04 LTS和JDK 8

的envsetup.sh給出:

============================================ 
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 
============================================ 

我嘗試用編譯使-J4

我得到愚蠢的錯誤:

============================================ 
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 
============================================ 

所以我改變了JDK 7的版本,但我得到同樣的錯誤,但倒:

============================================ 
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). 
************************************************************ 

那麼,什麼是PB?

我該如何解決?

感謝您的幫助

回答

1

你問一個的OpenJDK 8的構建,但你的版本是 java版 「1.7.x」 的Java(TM)SE運行時環境(建1.7.x)的HotSpot的Java(TM)

您需要像錯誤消息狀態那樣的Java 7。下載OpenJdk 7,並安裝它。那麼你需要

sudo update-alternatives --config java 

sudo update-alternatives --config javac 

在這兩個選擇1.7或7的版本。 谷歌和XDA已經涵蓋了這個... Java-8將用於Android N前進,但是對於KK和MM,你需要7.

+0

你可能還需要運行'ccache -C'並調出一個新的終端,甚至有時會重啓。 –

+0

https://nathanpfry.com/how-to-set-up-ubuntu-15-10-wily-werewolf-to-compile-android-roms/ –