Wrong Java Version.

2,613 views
Skip to first unread message

chris thomas

unread,
Dec 17, 2011, 6:02:50 PM12/17/11
to Android Building
When I run make, it gives me this:

"Checking build tools versions...
************************************************************
You are attempting to build with the incorrect version
of java.

Your version is: java version "1.6.0_22".
The correct version is: Java SE 1.6.

Please follow the machine setup instructions at
http://source.android.com/source/download.html
************************************************************
build/core/main.mk:131: *** stop. Stop."

Can anybody advise?

Jean-Baptiste Queru

unread,
Dec 19, 2011, 12:12:08 PM12/19/11
to android-...@googlegroups.com
It sounds like you're trying to build with OpenJDK, which isn't
compatible with Android. You'll need a Sun/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

--
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.

Simon John

unread,
Dec 19, 2011, 3:20:39 PM12/19/11
to android-...@googlegroups.com
just comment out line 131: $(error stop)

it should build ok with openjdk6 (not 7).

Conley Owens

unread,
Dec 19, 2011, 3:30:12 PM12/19/11
to android-...@googlegroups.com
You will encounter errors in cts if you try to build with openjdk6.

You can use the following steps to get the Sun JDK:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk

~cco3

Simon John

unread,
Dec 19, 2011, 9:54:52 PM12/19/11
to android-...@googlegroups.com
On Monday, December 19, 2011 9:30:12 PM UTC+1, Conley Owens wrote:
You will encounter errors in cts if you try to build with openjdk6.

You can use the following steps to get the Sun JDK:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk


except that package will get deleted from user's computers soon on ubuntu (as the last distributable version is 6u26 which is full of security holes) and is already unavailable on debian.

you could get 6u30 from oracle and manually install it, but its not a longterm solution, eventually android is going to have to build with openjdk7

Jean-Baptiste Queru

unread,
Dec 20, 2011, 10:48:14 AM12/20/11
to android-...@googlegroups.com
Why isn't that a long-term solution? We've been doing that on MacOS
since day 1, and we used to do that on Windows too before we started
to cross-compile.

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

--

roberj13

unread,
Dec 20, 2011, 10:47:55 AM12/20/11
to android-...@googlegroups.com

I was about to ask what the short term solution to this was going to be. Either manually installing, or compatibility with open jdk. Dependence on foreign oil err oracle is likely to be a painful transition.

Is it hoping for an update to open jdk that will make it fully replaceable as sun-jdk what we are looking for or a fix in our source tree to be compatible that way I guess is the question.

--

roberj13

unread,
Dec 20, 2011, 10:52:33 AM12/20/11
to android-...@googlegroups.com

I guess you answered the question in a roundabout way. I appreciate it and know you can't control these outside forces. Just wanted to confirm it would be the only package installed outside of ubuntu's repositories in the future.

Thanks.

John Kirk

unread,
Dec 20, 2011, 11:10:10 AM12/20/11
to android-...@googlegroups.com

The Java version required is in a Ubuntu repository. Im on my phone but can confirm when i get home. By following the instructions exactly and a little more info from the CyanogenMod wiki I was able to build on the second attempt.

Reply all
Reply to author
Forward
0 new messages