Experimental: building with OpenJDK

1,239 views
Skip to first unread message

Jean-Baptiste Queru

unread,
Dec 21, 2011, 3:57:17 PM12/21/11
to android-...@googlegroups.com
We've made a few changes to work around the differences between the
Oracle JDK and OpenJDK, and those changes are now in the AOSP master
branch.

Those changes seem to be enough to build the system (including user
builds, which is where we had the most trouble). It's not clear
whether the result actually works, and so far CTS seems to fail in
ways that aren't expected.

Right now the JDK version check is still in place, so if it trips on
OpenJDK it can be removed by changing the appropriate location in
build/core.

Feedback welcome.

JBQ

--
Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

brianwc

unread,
Dec 31, 2011, 3:40:26 AM12/31/11
to Android Building
I tried building with OpenJDK. It didn't seem to work. I'm on 64-bit
Debian Wheezy and did the following:

mkdir android ; cd android
aptitude install git-core gnupg flex bison gperf build-essential zip
curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-
dev libx11-dev lib32readline5-dev lib32z-dev libgl1-mesa-dev g++-
multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc
openjdk-6-jdk
mkdir ~/bin
PATH=~/bin:$PATH
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/
repo
chmod a+x ~/bin/repo
repo init -u https://android.googlesource.com/platform/manifest -b
android-4.0.3_r1
repo sync
source build/envsetup.sh
vi build/core/find-jdk-tools-jar.sh (changing ANDROID_JAVA_HOME to
just JAVA_HOME)
vi build/core/config.mk (commenting out java version check)
vi build/core/main.mk (commenting out java version check)
lunch full-eng
make -j4

It just stopped after a line that reads:
external/mesa3d/src/glsl/loop_controls.cpp:163:30: warning: by
‘virtual ir_visitor_status
loop_control_visitor::visit_leave(ir_loop*)’ [-Woverloaded-virtual]

It did not seem to create the emulator as typing "emulator" yields
command not found.

If it matters, I also have a symbolic link in /usr/lib/jvm like so:
java-6-sun -> java-6-openjdk-amd64

Any ideas what went wrong or what I could try from here to build with
OpenJDK?

Jean-Baptiste Queru

unread,
Jan 3, 2012, 11:08:07 AM1/3/12
to android-...@googlegroups.com
This sounds like an error when building native code, for which the
exact JDK should have no influence, so I'm guessing that you might be
hitting some other issue. Does the exact same build succeed when using
an Oracle JDK?

JBQ

> --
> You received this message because you are subscribed to the "Android Building" mailing list.
> To post to this group, send email to android-...@googlegroups.com
> To unsubscribe from this group, send email to
> android-buildi...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en

Reply all
Reply to author
Forward
0 new messages