To set up the android development environment on Ubuntu we need to first make sure that we have the correct version of Java set up on our machine.
Android (1.5) can run on either Sun JDK5 or JDK6.Its best to setup your Ubuntu box with JDK6.
Open up the terminal and type:
java –version
This will give you the default list of java versions installed on your machine.
If you have installed Sun’s JDK6 correctly you should get something like this:
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)
The following links will help you set up JDK6 correctly on your Ubuntu machine:
Installing through Add/Remove programs
https://jdk-distros.dev.java.net/ubuntu-dev.html
Through the command – line
http://www.cyberciti.biz/faq/howto-ubuntu-linux-install-configure-jdk-jr...
The above link is preferred because it also explains how to set up environment variables like $JAVA_HOME and $PATH.
Once you have completed the steps outlined in the links above , you can check whether you’ve got the correct version installed by running this command once again:
java –version
The following Ubuntu forum thread is useful for setting up both JDK6 as well as Eclipse.
http://ubuntuforums.org/showthread.php?t=333162
Setting up Eclipse on Ubuntu.
Setting up Eclipse is pretty straight forward.
Navigate to the site
http://www.eclipse.org/downloads/download.php?file=/technology/epp/downl...
Download and extract the tarball to a convenient location on your system. Open up the eclipse folder and simply click on the “eclipse” executable to start eclipse. (Click here for more information on how to untar files)
(You may want to create a shortcut for your self and place this somewhere on your desktop)
Once you have Eclipse up and running there are two things that you must do next:
1)Make sure eclipse is pointing to the correct JDK (JDK 6)
Try the following in eclipse.
Window -> Preferences -> Java -> Compiler (Set the version ie 6)
Window -> Preferences -> Java -> Installed JREs (Confirm your JRE)
2)Download the Android SDK,untar it to a suitable location on your machine.
Update bash-profile and follow the rest of the instructions on the Android website
to set up Eclipse with Android.
Other Android Resources
Anddev is a great place to get your question about android answered.It has great tutorials and a very helpful community.