Build environment for Android-x86

337 views
Skip to first unread message

Carbon Jiao

unread,
Dec 31, 2014, 4:15:20 AM12/31/14
to andro...@googlegroups.com
Dear Bosses,

Could you help to give some guidlines or advices for Android-x86 build environment?
I prepared build environment as:
   1. Ubuntu 12.04 /14.4  amd64 base on  http://source.android.com/source/building.html
   2. Archlinux amd64 base on https://wiki.archlinux.org/index.php/Android

    java 6u45,  make 3.81, python 2.7.9

While all faild when compilling webview (chromium)...

Anyone can share the environment informations?

Thanks a lot!
Carbon < carbonjiao # gmail dot com>

Carbon Jiao

unread,
Dec 31, 2014, 6:09:43 AM12/31/14
to andro...@googlegroups.com
target Java: webviewchromium (out/target/common/obj/JAVA_LIBRARIES/webviewchromium_intermediates/classes)
frameworks/webview/chromium/java/com/android/webview/chromium

104 errors
41 warnings
make: *** [out/target/common/obj/JAVA_LIBRARIES/webviewchromium_intermediates/classes-full-debug.jar] Error 41


在 2014年12月31日星期三UTC+8下午5时15分20秒,Carbon Jiao写道:

Mauro Rossi

unread,
Dec 31, 2014, 2:13:55 PM12/31/14
to andro...@googlegroups.com
Hi,

recently I had the exact same problem.
Here is how I solved, thanks to Chih-Wei instructions in another post (link this post).



With kitkat-x86 you need
Oracle JDK 6 installed:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java6-installer

If you have other JDK/versions installed, if you don't know check anyway, you'll have to setup java, javac and javap alternatives

The last one, javap, isn't even mentioned in AOSP Build Environment webpage, but it is indeed fundamental,
considering also this post https://groups.google.com/forum/#!searchin/android-x86/Surface_jni.h/android-x86/Qz6Hx1JtTvk/JXrHzF7VET4J


sudo update-alternatives --config java
...
There are 6 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-8-oracle/jre/bin/java          1072      auto mode
  1            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      manual mode
* 2            /usr/lib/jvm/java-6-oracle/jre/bin/java          1         manual mode
  3            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      manual mode
  4            /usr/lib/jvm/java-7-oracle/jre/bin/java          2         manual mode
  5            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1069      manual mode
  6            /usr/lib/jvm/java-8-oracle/jre/bin/java          1072      manual mode

Press enter to keep the current choice[*], or type selection number:

NOTE: you'll need to inspect your output, to set the correct choice.

Repeat for javac and javap:

sudo update-alternatives --config javac

sudo update-alternatives --config javap     <= remember this one




In case of lollipop-x86 build you need to install OpenJDK 7

sudo apt-get install openjdk-7-jdk


and setup java, javac and javap alternatives as

* /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java*


The javap alternative misconfiguration is very nasty to troubleshoot, thanks a lot Chih-Wei for his earlier post.
Mauro

Carbon Jiao

unread,
Jan 1, 2015, 8:42:08 AM1/1/15
to andro...@googlegroups.com
Thanks for your reply...
While there java javac javap all installed...

"(venv)[carbon@Carbon Android-x86]$ which java
/opt/java6/jdk1.6.0_45/bin/java
(venv)[carbon@Carbon Android-x86]$ which javac
/opt/java6/jdk1.6.0_45/bin/javac
(venv)[carbon@Carbon Android-x86]$ which javap
/opt/java6/jdk1.6.0_45/bin/javap

Carbon Jiao

unread,
Jan 5, 2015, 10:20:44 PM1/5/15
to andro...@googlegroups.com
Finally, I found the solution...

Need to uninstall all openjdk installed... and use sun jdk 1.6, such as in Ubuntu:
# apt-get purge openjdk* icedtea-* openjdk-*
to ensure all openjdk app removed:
# dpkg --list | grep -i jdk
# cd /usr/lib/jvm
# sudo rm -rf jdk<version>

Then install sun java
# mkdir /usr/java/
# cp jdk-6u45-linux-x64.bin /usr/java/
# chmod +x /usr/java/jdk-6u45-linux-x64.bin
# cd /usr/java/
# . jdk-6u45-linux-x64.bin

add below lines to /etc/profile
JAVA_HOME=/usr/java/jdk1.6.0_45
export JRE_HOME=$JAVA_HOME/jre 
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH   
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

then source /etc/profile

then build android-x86,  works...

Mauro Rossi

unread,
Jan 6, 2015, 9:32:53 AM1/6/15
to andro...@googlegroups.com
Hi,

good to hear that, Sun Java is now Oracle Java.

In my case it was not necessary to remove OpenJDK
Regards

Mauro
Reply all
Reply to author
Forward
0 new messages