1 在ubuntu中編譯android6.0時(shí)需要openjdk7, 但是openjdk-7-jdk 和openjdk-7-jre需要同時(shí)安裝。
成都創(chuàng)新互聯(lián)公司,為您提供網(wǎng)站建設(shè)公司、成都網(wǎng)站制作、網(wǎng)站營銷推廣、網(wǎng)站開發(fā)設(shè)計(jì),對服務(wù)成都集裝箱等多個(gè)行業(yè)擁有豐富的網(wǎng)站建設(shè)及推廣經(jīng)驗(yàn)。成都創(chuàng)新互聯(lián)公司網(wǎng)站建設(shè)公司成立于2013年,提供專業(yè)網(wǎng)站制作報(bào)價(jià)服務(wù),我們深知市場的競爭激烈,認(rèn)真對待每位客戶,為客戶提供賞心悅目的作品。 與客戶共同發(fā)展進(jìn)步,是我們永遠(yuǎn)的責(zé)任!$sudo apt-get install openjdk-7-jre
$sudo apt-get install openjdk-7-jdk
PS: openjdk-7-jre包只包含Java運(yùn)行時(shí)環(huán)境(Java Runtime Environment)。如果是要開發(fā)Java應(yīng)用程
序,則需要安裝openjdk-7-jdk包。
2 在ubuntu中更新jdk鏈接
Installing Oracle JDK 8 on Ubuntu:
Extract the tar file:
tar -xvzf jdk-8-linux-x64.tar.gz
Create jvm folder in /usr/lib, if jvm folder not exist
sudo mkdir /usr/lib/jvm
Move extracted jdk 8 folder to this location:
sudo mv jdk1.8.0 /usr/lib/jvm/jdk1.8.0
Install new java source in system:
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.8.0/bin/javac 1 sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0/bin/java 1 sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.8.0/bin/javaws 1
Choose default java:
sudo update-alternatives --config javac sudo update-alternatives --config java sudo update-alternatives --config javaws
Java version test:
java -version
參考鏈接 http://www.devsniper.com/install-jdk-8-on-ubuntu/
3 android N 編譯
1)編譯錯(cuò)誤
Java heap spaceTry increasing heap size with java option '-Xmx'Warning: This may have produced partial or corrupted output.ninja: build stopped: subcommand failed.build/core/ninja.mk:146: recipe for target 'ninja_wrapper' failed make: *** [ninja_wrapper] Error 1
解決方案: 在文件 out/host/linux-x86/bin/jack-admin 添加 值
export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation " 然后重啟 out/host/linux-x86/bin/jack-admin kill-server out/host/linux-x86/bin/jack-admin start-server 5 編譯andorid orea,內(nèi)存不夠: 解決方案: The problem is that virtual machine which runs jack doesn't have enough memory. You can try to edit jvm command:JACK_VM_COMMAND=${JACK_VM_COMMAND:="java -Xmx4096m"} or to decrease number of parallel jack compilationsSERVER_NB_COMPILE=2 in file. You can read jack documentation for details.EDIT: Changing .jack file didn't work for me. After digging a little deeper I found that jack server is started with out/host/linux-x86/bin/jack-admin script and it's parameters can be passed with JACK_SERVER_VM_ARGUMENTS environment variable.So my solution was to set it and restart jack server before building aosp :
6在android8orea, cts中添加第三方j(luò)ar包:LOCAL_STATIC_JAVA_LIBRARIES :=poi(在compatibility-host-util andorid.mk 文件中)
make cts時(shí),出現(xiàn)錯(cuò)誤:
ninja: error: '/media/camille/android_src/out/androidOrea/host/common/obj/JAVA_LIBRARIES/poi_intermediates/classes.jar', needed by '/media/camille/android_src/out/androidOrea/host/common/obj/JAVA_LIBRARIES/compatibility-host-util_intermediates/classes-full-debug.jar', missing and no known rule to make it
15:00:20 ninja failed with: exit status 1
build/core/main.mk:21: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1
說明編譯package compatibility-host-util 需要poi_intermediates下的文件classes.jar。
解決方法: 復(fù)制一份poi_intermediates下的文件javalib.jar, rename to classes.jar。再次編譯,就可以了。
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。