Ubuntu 9.10, Java 5 and the Android Open Source Project

出处: http://blog.enea.com/Blog/bid/32050/Ubuntu-9-10-Java-5-and-the-Android-Open-Source-Project


Currently there is an issue with building the Android Open Source project on Ubuntu 9.10 Karmic Koala, or more specific with the Java 5 support. Java 5 was obsoleted by Sun on October 30 2009 and is not part of the Ubuntu 9.10 distribution. However there is still a need to use Java 5 for building Android since Java6 is not yet supported. There are two methods to get Java5 working on Ubuntu 9.10.

Method 1 - download and install from Sun
This method will let you install the Java5 JDK in a separate directory and add it to the path.
Download the Java5 JDK for Linux from http://java.sun.com/javase/downloads/5u21/jdk
This is a binary file that you should save to a suitable location like ~/tools
In order to make i executable chmod the file as

  $ chmod 777 jdk-1_5_0_21-linux-i586.bin

and run it

  $ ./jdk-1_5_0_21-linux-i586.bin

This will install the jdk to the current directory.
To use the JDK5 tools you need to add it first in the path before building the Android Open Source Project

  $ export PATH=~/tools/jdk1.5.0_21/bin

This allows you to remove the JDK5 from the path when not building Android and use the standard Java settings instead.

Method 2 - use the Ubuntu 9.04 repositories to get Java5
This method adds the Jaunty repositories and installs Java5 as the default java setting in the system. Open the sources file (/etc/apt/sources.list) for editing, as root

  $ sudo gedit /etc/apt/sources.list

and add:

  deb http://us.archive.ubuntu.com/ubuntu/ jaunty multiverse
  deb http://us.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse

save the file and close gedit. Next sync your sources by running

  $ sudo apt-get update

and install

  $ sudo apt-get install sun-java5-jdk

To set the system to use Java 5 you need to update your java alternatives by running

  $ sudo update-alternatives --config java

Choose java-1.5.0-sun and you should be done.

Hopefully the Android Open Source Project will build with Java 6 shortly but the above solutions should get you going with platform work on Ubuntu 9.10.



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值