tags:

views:

262

answers:

3

Trying to build Android open source project on Ubuntu 10.04 (on VMware Player).

I followed the instructions at this link (and it said to use sun-java5 JDK 1.5 which takes some fishing to find for Ubuntu) -

http://source.android.com/source/download.html

Got 299 compile errors. Wondering if the direction to use JDK 1.5 is out of date? Some of the errors are as follows (and many similar) -

external/jsilver/src/com/google/clearsilver/jsilver/data/HDFDataFactory.java:77: method does not override a method from its superclass
  @Override

external/jsilver/src/com/google/clearsilver/jsilver/data/UniqueStack.java:106: cannot find symbol
symbol  : method offerLast(T)
location: class java.util.LinkedList<T>
    objectStack.offerLast(object);


external/jsilver/src/com/google/streamhtmlparser/impl/HtmlParserImpl.java:507: cannot find symbol
symbol  : method isEmpty()
location: class java.lang.String
    if (!tagString.isEmpty() && tagString.charAt(0) == '/') {


external/jsilver/src/com/google/streamhtmlparser/util/JavascriptTokenBuffer.java:80: cannot find symbol
symbol  : method copyOf(char[],int)
location: class java.util.Arrays
    buffer = Arrays.copyOf(aJavascriptTokenBuffer.buffer,
A: 

Partial answer to my own question - switched to java6 and got further in the build process. The instructions on the Android download page appear to be out of date.

Now having problems with not having the right C++ libraries installed on ubuntu... So build is not yet successful

jotobjects
What version Ubuntu 10.04 are you using? Is it a 32bit or 64bit? About the java5 issue. I've seen that information somewhere on the developer page where they explained that java5 will generate errors due to overriding being bugged or something.
Octavian Damiean
the Android trunk now requires JDK 1.6. The current release (Froyo) branch require JDK 1.5.
jotobjects
A: 

I read in another blog that it is nesessary to compile in a 64bit and with java6, but I am mot sure yet, I trying to find another solution

German
Here is the link mentioned https://groups.google.com/group/android-building/browse_thread/thread/750f55cddd7aa4b5
German
Yes - the Android trunk now requires JDK 1.6. The current release (Froyo) branch require JDK 1.5. The build instructions don't tell you that...
jotobjects
A: 

Thanks for comments and suggestions.

Conclusion - I did get a successful build with Sun JDK 1.6. It took 7 or 8 attempts and doing "make clean" every time was important.

Note the errors shown in the question above are for java methods that were added in Java 1.6 - so the Android source requires Java 1.6 now on the master source branch (see link from German in this thread) even though the directions say to use Java 1.5. It failed trying to do a 64 bit build due to C library dependencies. I used the suggested solution in the following link that required making a small change to 4 make files so it could do a 32 bit build (the makefiles are set up to do a 64 bit build if you are using Java 1.6 for some reason).

See "sol 2" by user amberved at this link - that is what worked for me. http://ubuntuforums.org/showthread.php?t=1524292

In answer to the above comment questions - um I think I have 32bit Ubuntu (how do I tell?). System is Ubuntu running on VMware running on 32bit Vista system. Regarding "necessary to compile in 64bit with java6" my edits to the referenced makefiles is the workaround for 32bit build.

I think uname would report something like i686_64 if Linux was 64 bit OS?

uname -a Linux jotobjects-ubuntu 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010 i686 GNU/Linux

jotobjects
You are running a 32bit version. If you'd run a 64bit version there would be x86_64 in this output. Glad to see you've solved your problem! You can accept your won answer to indicate that this question is solved now.
Octavian Damiean
Why are you posting answers to your own question instead of updating the question itself?
MAK
Sorry I don't know the protocol. Would editing the question show that the question had an answer?
jotobjects
It says I have to wait 22 hours before I can "accept" my own answer
jotobjects