In this article, the main solution to a Java or Android development in the first step to solve the problem, that is, the configuration of environment variables. As this part of the online there are many tutorials, uneven. I'm mainly here to summarize the environment variables for both JDK and adb/android, and provide several different implementations for each type of configuration.
"1" JDK environment variable configuration
The JDK installation directory is: C:\Program Files (x86) \java\jdk1.7.0_45. JDK environment variable Configuration there are three methods, absolute path method, Java_home method, and complete method.
(1) Absolute path method: The configuration of the JDK's environment variables all use absolute paths. Is the simplest configuration method.
Path=c:\program Files (x86) \java\jdk1.7.0_45\bin; C:\Program Files (x86) \java\jdk1.7.0_45\jre\bin
(2) Java_home method: This is the most common configuration method, the change is more convenient, more flexible. It can also be understood as a relative path.
Java_home=c:\program Files (x86) \java\jdk1.7.0_45
Path in =%java_home%\bin;%java_home%\jre\bin;
(3) Complete law: The classpath is added on the basis of the Java_home method. In some uses, the classpath may be used to find the path. This is the recommended way to use it.
Java_home=c:\program Files (x86) \java\jdk1.7.0_45
Path=%java_home%\bin;%java_home%\jre\bin;
Classpath=,;%java_home%\lib;%java_home%\lib\dt.jar;%java_home%\lib\tools.jar (Note: Classpath to.; Beginning. "Dot semicolon" in English state)
After the JDK is configured successfully, enter java,javac,java-version under CMD with the following effects:
"2" adb/android environment variable configuration
When I used to develop Android, I always thought that using ides like Eclipse, Android Studio is not required to configure environment variables, except JDK. With the subsequent increase in testing and debugging, it is found that Android also needs to configure the environment variables, which will make development faster and more convenient. So be sure to do this step work.
The path of my Android SDK is: D:\ADT-BUNDLE\SDK; (everyone changes according to personal situation)
(1) Absolute path method: All are configured with absolute path.
Path=d:\adt-bundle\sdk\platform-tools;d:\adt-bundle\sdk\tools;
(2) Android_home method: Can be analogous to Java_home method.
Android_home=d:\adt-bundle\sdk
Path=%android_home%\platform-tools;%android_home%\tools;
After the ADB/ANDROID environment variable is configured successfully, the Adb,android list effect is entered in CMD as follows:
。
At this point, the environment variable has been configured, you can write the code to the fullest.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Complete tutorial on JDK and adb/android environment variable configuration