重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
1 在ubuntu中编译android6.0时需要openjdk7, 但是openjdk-7-jdk 和openjdk-7-jre需要同时安装。
成都创新互联公司,为您提供网站建设公司、成都网站制作、网站营销推广、网站开发设计,对服务成都集装箱等多个行业拥有丰富的网站建设及推广经验。成都创新互联公司网站建设公司成立于2013年,提供专业网站制作报价服务,我们深知市场的竞争激烈,认真对待每位客户,为客户提供赏心悦目的作品。 与客户共同发展进步,是我们永远的责任!$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'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。再次编译,就可以了。
另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。