Which JDK for Android Development on Ubuntu 10.04

2019-07-19 05:45发布

问题:

Ubuntu 10.04 64-bit looks promising as a development environment for Android. I now have it up and running but I am stuck at the following decision point:

  1. Synaptic Package Manager has 'default-jdk' ("Standard Java or Java compatible Development Kit").

sun.com has two "Java SE Development Kit 6u23 for Linux x64, Multi-language":

  1. Java SE Development Kit 6u23: jdk-6u23-linux-x64-rpm.bin
  2. Java SE Development Kit 6u23: jdk-6u23-linux-x64.bin

Which one is the right one for Android development using eclipse-SDK-3.6.1-linux-gtk-x86_64.tar.gz?

回答1:

The one for synaptic will work just fine.

Java SE Development Kit 6u23: jdk-6u23-linux-x64-rpm.bin

RPM == Redhat Package Manager... so, don't use it since you are using Ubuntu.

Java SE Development Kit 6u23: jdk-6u23-linux-x64.bin

With that bundle it will work just fine. You will need to configure manually the path and things like that.



回答2:

Install sun's java JDK. You can follow this guide.

http://beeznest.wordpress.com/2010/04/23/howto-install-suns-java-on-ubuntu-lucid-lynx-10-04/

Edit Link edited. That was for the java plugin

Another Edit

I'm not sure about ia32-libs or whatever. I've never had to do it. What did you install when you first brought the system up? I've always done:

sudo apt-get install ubuntu-restricted-extras build-essential linux-headers-`uname -r`

And that pretty much installs everything I need. I think on maverick that installs sun-java as well, but not entirely sure.



回答3:

Then again, http://developer.android.com/sdk/installing.html seems to suggest a different approach:

  1. apt-get install ia32-libs
  2. apt-get install sun-java6-jdk

Update: It turns out that without the ia32-libs, adb will refuse to run. So, the requirement for both ia32-libs (on 64-bit Ubuntu) and the JDK as outlined on the android website is still valid.

The HelloAndroid basic application runs just fine from within Eclipse, when only the 'default-jdk' from Synaptic is installed. So, it seems that 'sun-java6-jdk' is not mandatory and @Cristian was right, so I will shortly mark his answer as accepted.