Building Platform code with a non standard JAVA installation

75 views
Skip to first unread message

nictam

unread,
Dec 1, 2009, 5:37:00 AM12/1/09
to android-platform
Hello,

at my company we are using Ubuntu servers where we are standard users
(e.g. cannot run 'sudo' commands). Servers have Ubuntu 9.04 and as
such don't have a compatible version of JAVA installed in standard
location (/usr/bin).

As per JQB request (see http://groups.google.com/group/android-platform/browse_thread/thread/9522b1c7b0c85b13)
I am putting down these instructions with the hope that more people
can test/validate the method so that it can be documented by Google.

By default, on our server, using the Ubuntu 9.04 fresh install, java -
version returns:
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Server VM (build 14.0-b16, mixed mode)

The steps I follow for a complete build are:

1- download the Eclair public s/w using the manifest (e.g. repo init -
u blablabla -b eclair)
2- download the Sun JDK 1.5.0.22 from http://java.sun.com/javase/downloads/index_jdk5.jsp,
and install it in a shared drive where standard users have write
permission (in my case this is an NFS mounted drive)
3- I set PATH to include the JDK bin folder, e.g. export PATH=<path to
JDK>/bin:$PATH. At this point, if I run java -version again, I have
this:
java version "1.5.0_22"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03)
Java HotSpot(TM) Server VM (build 1.5.0_22-b03, mixed mode)
4- run '. build/envsetup.sh' at the root of the Android source folder
5- run 'make'

Everything builds fine, and I am able to boot the file system.

Some remarks:
- if I don't add my JDK/bin in PATH, Android complains about JAVA
version when checking the build tools version.
- if I add a trailing '/' in my PATH, e.g. PATH=<jdk>/bin/:$PATH, my
build fails with some obscure errors related to droidoc, so make sure
to remove the trailing '/'. That can potentially require some more
investigations to understand the root cause.

The point here is that I could workaround the JAVA installation issues
without the need for 'sudo' commands. The only requirement is to get
enough disk space (either local disk or NFS drive).

Would appreciate review/feedback on this, and I hope this can simplify
installation requirements, and that Google doc can be updated as well,
if this is proven to work for everyone.

thx. nictam.

Ask

unread,
Dec 8, 2009, 8:35:33 AM12/8/09
to android-platform
Hi nictam,

Thanks a lot... Your trick has worked for me too :)

Cheers,
Asif

On Dec 1, 3:37 pm, nictam <nic...@gmail.com> wrote:
> Hello,
>
> at my company we are using Ubuntu servers where we are standard users
> (e.g. cannot run 'sudo' commands). Servers have Ubuntu 9.04 and as
> such don't have a compatible version of JAVA installed in standard
> location (/usr/bin).
>
> As per JQB request (seehttp://groups.google.com/group/android-platform/browse_thread/thread/...)
> I am putting down these instructions with the hope that more people
> can test/validate the method so that it can be documented by Google.
>
> By default, on our server, using the Ubuntu 9.04 fresh install, java -
> version returns:
> java version "1.6.0_14"
> Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
> Java HotSpot(TM) Server VM (build 14.0-b16, mixed mode)
>
> The steps I follow for a complete build are:
>
> 1- download the Eclair public s/w using the manifest (e.g. repo init -
> u blablabla -b eclair)
> 2- download the Sun JDK 1.5.0.22 fromhttp://java.sun.com/javase/downloads/index_jdk5.jsp,
Reply all
Reply to author
Forward
0 new messages