安装JDK1.6:

  1. $ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
  2. $ sudo apt-get update  
  3. $ sudo apt-get install sun-java6-jdk  

 

root@hens-desktop:/Android# sudo apt-get install sun-java6-jdk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package sun-java6-jdk has no installation candidate
root@hens-desktop:/Android# sudo apt-get install sun-java6-jdk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package sun-java6-jdk has no installation candidate

 解决方法是:

$ sudo chmod go+w sources.list)

$ sudo apt-get update

再试$ sudo apt-get install sun-java6-jdk

安装到configuring sun-java6-jre 时OK点不到,需要按下tab。

如果此时你把页面关了,则你想再进入配置页就要输入:sudo apt-get -f install 这是查询安装的所有依赖包。否则你想install或者reinstall都不行,会报:ia32-sun-java6 gsfonts-x11 Unmet dependencies这些错误。

最后用java -version测试,可以看到如何下图:


安装JDK1.6: apt-get_ubuntu

说明安装的版本没有错,就是我们需要的!

 

接下来还要安装开发过程需要的一些包:

root@hens-desktop:/Android# sudo apt-get install git-core gnupg valgrind flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip crul libncurses5-dev libsdl1.2-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
git-core is already the newest version.
gnupg is already the newest version.
Note, selecting libsdl1.2-dev instead of libsdl-dev
zip is already the newest version.
E: Couldn't find package crul
root@hens-desktop:/Android# sudo apt-get install git-core gnupg valgrind flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev libsdl1.2-dev    用这个就可以安装。

 

 

root@hens-desktop:/Android/My_Android# repo init -u git://android.googlesource.com/platform/manifest -b android-4.0.1_r1
/root/bin/repo: line 1: syntax error near unexpected token `newline'
/root/bin/repo: line 1: `<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">'

每次都是到这里不停了,每次都是这样就失望,绝望了,就这样被吊死在一棵树上。

 

         实在不想这样不明不白的下去,但是自己又找不到原因,被逼无奈,只好试试把ubuntu 10.4改为用ubuntu 11.10,步骤如下:

$sudo apt-get install git-core gnupg valgrind flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev libsdl1.2-dev

注意其中的是1还是小写字母的l,很多情况下是因为这个原因才不能安装成功!

 

$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk

安装JDK1.6,不料又是这样:


安装JDK1.6: apt-get_Android_02

似乎顺利的路从来都不会在我身上发生,好吧,不管怎么样总得走完这条路吧,重在过程,但是要做好吃苦的心理准备,还要耐得住气,再找找方法。

 

添加这个源:

deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse
sudo gedit /etc/apt/sources.lis

 


打开源列表,在最后一行添加

deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse


保存退出。

更新apt源

sudo apt-get update


安装sun-java6-jdk

sudo apt-get install sun-java6-jdk



 




安装JDK1.6: apt-get_ubuntu_03


 


到这里Do you want to continue [Y/n]?输入 y回车,这个过程应该持续十分钟左右后,出现:


 


安装JDK1.6: apt-get_Android_04


 


按下“Tab”选中OK后回车确定


 


安装JDK1.6: apt-get_Android_05



确定后出现:

 

安装JDK1.6: apt-get_java_06

 

用方向键选择“Yes”再回车,好玩吧。


安装JDK1.6: apt-get_Android_07

 

再次回车后表示JDK1.6安装成功。

 

接下来就是Android 源码和内核的获取