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:
$ 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
Soltuion:
reference to this blog, especially the last part:
1.Download jdk-6u38-linux-x64.binhttp://www.oracle.com/technetwork/java/javase/downloads/jdk6u38-downloads-1877406.html2. 設為可執行檔chmod +x jdk-6u38-linux-x64.bin3. 解開./jdk-6u32-linux-x64.bin4.建立jvm資料夾sudo mkdir /usr/lib/jvm5.移至jvm資料夾sudo mv jdk1.6.0_38 /usr/lib/jvm/jdk1.6.0_386.設定環境變數吧(還是替換)sudo update-alternatives –-install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_38/bin/javac 1sudo update-alternatives –-install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_38/bin/java 1sudo update-alternatives –-install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_38/bin/javaws 1sudo update-alternatives –-config javacsudo update-alternatives –-config javaws
sudo update-alternatives –-config java