您好,登錄后才能下訂單哦!
1 在ubuntu中編譯android6.0時需要openjdk7, 但是openjdk-7-jdk 和openjdk-7-jre需要同時安裝。
$sudo apt-get install openjdk-7-jre
$sudo apt-get install openjdk-7-jdk
PS: openjdk-7-jre包只包含Java運行時環境(Java Runtime Environment)。如果是要開發Java應用程
序,則需要安裝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)編譯錯誤
Java heap spaceTry increasing heap size with java option '-Xmx<size>'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,內存不夠: 解決方案: 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中添加第三方jar包:LOCAL_STATIC_JAVA_LIBRARIES :=poi(在compatibility-host-util andorid.mk 文件中)
make cts時,出現錯誤:
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。
解決方法: 復制一份poi_intermediates下的文件javalib.jar, rename to classes.jar。再次編譯,就可以了。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。