Troubles in Building Android Source Code

Some Troubles or problems you may encounter while you setup the Android source code build environment on Ubutun 12.4.4

1. Install Sun-jdk1.6

prompt:

Troubles in Building Android Source Code
$ 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
Troubles in Building Android Source Code

Soltuion:

reference to this blog, especially the last part:

1.Download jdk-6u38-linux-x64.bin
http://www.oracle.com/technetwork/java/javase/downloads/jdk6u38-downloads-1877406.html
 
2. 設為可執行檔
chmod +x jdk-6u38-linux-x64.bin
3. 解開
./jdk-6u32-linux-x64.bin
4.建立jvm資料夾
sudo mkdir /usr/lib/jvm
5.移至jvm資料夾
sudo mv jdk1.6.0_38 /usr/lib/jvm/jdk1.6.0_38
6.設定環境變數吧(還是替換)
sudo update-alternatives –-install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_38/bin/javac 1
sudo update-alternatives –-install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_38/bin/java 1
sudo update-alternatives –-install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_38/bin/javaws 1
 
sudo update-alternatives –-config javac

sudo update-alternatives –-config javaws
sudo update-alternatives –-config java

 

Troubles in Building Android Source Code,布布扣,bubuko.com

Troubles in Building Android Source Code

上一篇:Android的BUG(三) - 广为人知的诟病:频繁重启问题( 转)


下一篇:android中的ContentProvider实现数据共享