Installation Of Required Development Environment For Android in Windows, Linux and Mac OS


What is “JDK” or “JRE”?
JRE (Java Runtime Environment) is required for running Java programs. JDK (Java Development Kit) is a package which includes JRE and the development tools (such as compiler and debugger), is needed for writing as well as running java programs. The most used version of JDK are :
  1. Java SE 7(codename Dolphin) (Released : July 28,2011): also called Oracle JDK
  2. Java SE 8(Released : March 18,2014): latest version
Here we will install Java SE 8.

A. For Windows
  • Install JDK : Run the executable jdk-8uxx-windows-x64.exe which will install both JDK and JRE
  • Download Eclipse:
  • Extract All
  • Right click on eclipse.exe and create Shortcut. You may drag this shortcut to your Desktop or Start Menu
  • Each time you run Eclipse, you will be prompted to select a workspace, which is where the programs you write are stored.The default workspace is C:\Users\<username>\workspace
  • Run the exe file which will launch Android SDK Tool Setup wizard to guide you throughout of the installation.
  • Launch Android SDK Manager using the option All Programs> Android SDK Tools > SDK Manager
  • By default it will display total 7 packages to be installed, de-select Documentation for Android SDK and Samples for SDK packages to reduce installation time and proceed forward.
  • To Setup Android Development Tools (ADT) Plugin choose Help> Software Updates > Install New Software
  • Click Add Button to add ADT Plugin as name and https://dl-ssl.google.com/android/eclipse/ as the location. Eclipse will start searching for the plug-in available in the given location and finally list down the found plugins.So just download it.
  • To create Android Virtual Device : launch Android AVD Manager using Windows> AVD Manager>
  • Click New button to create a new Android Virtual Device and fill up the required information and click Create AVD button.


B. For Linux
  • Open terminal and install this command to make new directory to install JDK
    $ cd /usr/local
    $ sudo mkdir java
  • extract the downloaded package
    $ cd /usr/local/java
    $ sudo tar xzvf ~/Downloads/jdk-8u{xx}-linux-x64.tar.gz
    {xx} is the upgrade number
    // x: extract , z: for unzipping gz, v : verbose, f: filename
  • Infrom the ubuntu to use this JDK
    // Setup the location of java, javac and javaws
    $ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.8.0_{xx}/jre/bin/java" 1
    // --install symlink name path priority
    $ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.8.0_{xx}/bin/javac" 1
    $ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jdk1.8.0_{xx}/jre/bin/javaws" 1
    // Use this Oracle JDK/JRE as the default
    $ sudo update-alternatives --set java /usr/local/java/jdk1.8.0_{xx}/jre/bin/java
    // --set name path
    $ sudo update-alternatives --set javac /usr/local/java/jdk1.8.0_{xx}/bin/javac
    $ sudo update-alternatives --set javaws /usr/local/java/jdk1.8.0_{xx}/jre/bin/javaws
  • Install Eclipse :
    // Unzip the tarball into /usr/local
    $ cd /usr/local
    $ sudo tar xzvf ~/Downloads/eclipse-jee-luna-R-linux-gtk-x86_64.tar.gz
    // Extract the downloaded package
    // x: extract, z: for unzipping gz, v: verbose, f: filename
    // You can also unzip in "File Explorer" by double-clicking the tarball.
    // Change ownership
    $ cd /usr/local
    $ sudo chown -R your-username:your-groupname eclipse
    // Change ownership to your chosen username and groupname
    // -R recursive
    // Set up a symlink
    $ cd /usr/bin
    $ sudo ln -s /usr/local/eclipse/eclipse
    // Make a symlink in /usr/bin, which is in the PATH.
    $ ls -ld eclipse
    lrwxrwxrwx 1 root root 26 Aug 30 11:53 eclipse -> /usr/local/eclipse/eclipse
    $ which eclipse
    /usr/bin/eclipse
    $ whereis eclipse
    eclipse: /usr/bin/eclipse /usr/bin/X11/eclipse /usr/local/eclipse
  • To run Eclipse : go to “/usr/local/eclipse” folder and click on the Eclipse icon or start Terminal and enter “eclipse”
  • Each time you run Eclipse, you will be prompted to select a workspace, which is where the programs you write are stored.The default workspace is C:\Users\<username>\workspace
  • Check out the instructions provided along iwht the downloaded android-sdk_rXX-linux.tgz file for linux.
  • Launch Android SDK Manager using the option All Programs> Android SDK Tools > SDK Manager
  • By default it will display total 7 packages to be installed, de-select Documentation for Android SDK and Samples for SDK packages to reduce installation time and proceed forward.
  • To Setup Android Development Tools (ADT) Plugin choose Help> Software Updates > Install New Software
  • Click Add Button to add ADT Plugin as name and https://dl-ssl.google.com/android/eclipse/ as the location. Eclipse will start searching for the plug-in available in the given location and finally list down the found plugins.So just download it.
  • To create Android Virtual Device : launch Android AVD Manager using Windows> AVD Manager>
  • Click New button to create a new Android Virtual Device and fill up the required information and click Create AVD button.
C. For Mac
  • In some Mac Systems (earlier than Mac Os X 10.7 Lion), JDK has been pre-installed. To check go to terminal and issue these commands : $ javac -version
  • If not installed then go to http://connect.apple.com/
  • Login with your AppleID.
  • Download “Java for Mac OS X {10.x} Update {u} Developer Package (DMG)” .
  • Choose {10.x} according to your Mac OS X version and the Latest {u}.
  • Double-click to install the downloaded Disk Image (DMG) file.
  • Eject the DMG file.
  • Find eclipse-java-helios-SR2-macosx-cocoa.tar.gz in your Downloads folder, and drag it to the Desktop. Then double-click it. You will see a folder named "eclipse."
  • Drag the "eclipse" folder into your Applications folder. The easiest way to do so is to open a new window in the Finder and click on Applications in the list you get on the left-hand side. Then drag the "eclipse" folder in with the other applications. Make sure that you do not drag it into a folder that's already within Applications. In other words, when you're done, the Applications folder should have directly within it a folder named "eclipse."
  • (This step is not required, but it's strongly recommended.) Double click the "eclipse" folder. You'll see an application named "Eclipse"; it has a purple icon with white horizontal stripes. Drag it into your dock. Now you will be able to launch Eclipse by clicking on the icon in the dock.
  • You may now drag eclipse-java-helios-SR2-macosx-cocoa.tar.gz to the Trash. Empty the Trash whenever you wish.
  • When you launch Eclipse for the first time, you'll be asked "'Eclipse' is an application downloaded from the Internet. Are you sure you want to open it?" Click "Open."
  • Each time you run Eclipse, you will be prompted to select a workspace, which is where the programs you write are stored.The default workspace is /Users/thc/Documents/workspace
  • Check out the instructions provided along iwht the downloaded android-sdk_rXX-macosx.zip file for Mac OS.
  • Launch Android SDK Manager using the option All Programs> Android SDK Tools > SDK Manager
  • By default it will display total 7 packages to be installed, de-select Documentation for Android SDK and Samples for SDK packages to reduce installation time and proceed forward.
  • To Setup Android Development Tools (ADT) Plugin choose Help> Software Updates > Install New Software
  • Click Add Button to add ADT Plugin as name and https://dl-ssl.google.com/android/eclipse/ as the location. Eclipse will start searching for the plug-in available in the given location and finally list down the found plugins.So just download it.
  • To create Android Virtual Device : launch Android AVD Manager using Windows> AVD Manager>
  • Click New button to create a new Android Virtual Device and fill up the required information and click Create AVD button.

Comments

Popular Posts