Android Development environment Setup (with Java environment configuration)

Source: Internet
Author: User

Objective

Since the touch of Java, the configuration environment variables have been tossing several times, also several times have been confused, and then often the Internet access to relevant information to solve. But after some time some details will not be remembered, when to be configured on other machines on the Internet to check or consult the relevant books, so repeatedly very troublesome, and some of the online methods outdated, including some unnecessary configuration, each of these to do is to do some unnecessary work. So it becomes more and more to know the reason why, need to put their own groping. Here's how the Android and Java environment is built using the experience of this build.

First step: Install Java JDK

Download the SDK version of your own machine into the Oracle website. Java is divided into Java SE (Standard Edition, to meet most basic development needs), Java EE (Enterprise-oriented), Java ME (mobile-oriented, such as embedded), each version has a corresponding SDK, generally using the first two. If not web development, download the SDK for Java SE, and if you want to do Web development, download the Java EE SDK, which contains the former. The two URLs are as follows:

Java se:http://www.oracle.com/technetwork/java/javase/downloads/index.html

Java ee:http://www.oracle.com/technetwork/java/javaee/downloads/index.html

Download down after installation, 32-bit default installation under C:\Program Files (x86) \java\, 64-bit default installation under C:\Program files\java\, you can specify the path yourself.

When you select a custom installation at installation time, the developer tools, demo program, source code, and public JRE four modules are available for installation. Removing the common JRE here does not install it because it is primarily used to provide a running environment for running Java applets on the browser, which is rarely required. If you choose to install a public JRE, you can see that there is a JRE folder under the SDK Sibling folder, which explains the confusion in choosing a default installation of two JRE--sdk folder with the JRE folder and a JRE folder alongside the SDK folder.

Step Two: Configure the JDK

After installing the JDK, you can find that jdk\bin\ and Jdk\jre\bin have many executable programs named EXE, which are the tools that the JDK contains, such as Javac.exe, Jar.exe, etc. To be able to run them directly on the command line, you need to configure the environment variables.

1. New java_home system environment variable, value is the directory of the JDK installed in the first step. Software such as Eclipse relies on this variable, and at run time it automatically detects whether the variable is defined and whether it has a JDK

2, add after the path variable;%java_home%\bin;%java_home%\jre\bin

After the two-step setup, you can run the command at the command line and the JDK will be detected after Eclipse is started.

In the previous (included) version of Java1.5, you also need to set the CLASSPATH variable with a value of.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar, the variable value string is preceded by a "." Represents the current directory. The purpose of setting this variable is to tell the Java execution Environment which directories can be used to find the classes or packages required for the Java program to be executed. It is no longer necessary to set this variable in a later version of Java1.5 and will automatically go to the above three directories to find what is needed when executing a Java program.

Step three: Download and install eclipse

Eclipse is an IDE (integrated development environment) developed for Java applications and Android. Eclipse does not need to be installed, download the corresponding version to unzip the unpacking package, cut the Eclipse folder to the place where you want to install it, and set up your working directory when you open it.

Fourth step: Download the Android SDK

Android Development environment Setup (with Java environment configuration)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.