--------------------------Every command will be initiated from the terminal----------------------------------------------
Installing Sun Java on Newer versions of Ubuntu (10.04 an above), Linux Mint
Open the terminal and type the following:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install oracle-java6-installer
That should install the Sun Java version on your system. To change to it simply do the following in case you have other java alternatives:
sudo update-java-alternatives -s java-6-oracle
If you want the installation to be automatic type the following:
sudo echo oracle-java6-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
after that simply do the following to set the default environment variables:
sudo apt-get install oracle-java7-set-default
Note that the PPA includes versions 6, 7 and 8. So you can install any of them by simply changing the number in the installation line, for example:
sudo apt-get install oracle-java8-installer
Would install Java 8. After installing the Java version you wish to use and setting the version to the default with the update-java-alternatives command, you can check which version you are using by typing the following:
java -version
It will show you the default version you are using at that moment.
For Debian we have to use a different method. Each line is a command in the terminal.
su -
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" > /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" >> /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
apt-get update
apt-get install oracle-java6-installer
exit
---------------------------Now to install tool for compiling android-----------------------------------------------------
Run the following command:
sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev pngcrush schedtool libxml2 libxml2-utils xsltproc g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline-gplv2-dev gcc-multilib liblz4-tool android-tools-adb android-tools-fastboot
*Note: for debian you must add repositories for Sid distro
Now you need to set up your directories :
mkdir -p ~/bin
mkdir -p ~/android
----------------------------Install the repo command---------------------------------------------------------------------
Enter the following to download the "repo" binary and make it executable (runnable):
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
Put the ~/bin directory in your path of execution
Make sure that the ~/bin directory you just created is in your path of execution so that you can easily run the repo command even when you're not in ~/bin. Assuming you are using the BASH shell, the default in recent versions of Ubuntu, you can set it like this:
export PATH=${PATH}:~/bin
-----------------------------Initialize the source repository-----------------------------------------------
cd ~/android
repo init -u
Download the source code
repo sync