Install Android Studio Win7

Source: Internet
Author: User

The long-awaited Google I/O 2013 conference did not bring us Android5.0 or Adnroid4.3, but brought about Android Studio. Although it is a preview version, it is based on Intellij IDEA, however, developers are also excited. It seems that Google has to pay attention to developers.

As a newbie studying Android development, I learned about the release of Android Studio, so I can't wait to try it out. First, install it in Linux, and there is no difficulty in installing it. I feel that the so-called graphic interface is not bad. When I install it in Win7, because I have installed Eclipse before, during the installation, it can automatically find the installed jdk (1.7), after the installation is complete, the environment is configured, and then restart (do not forget to restart it to make the set environment variables take effect ). When you are excited to open the file, double-clicking the exe file does not respond. Then run cmd and run data studio. The result is displayed.

No JDK is found. Didn't you automatically find the JDK installation directory at the beginning of the installation? Let's look at it later. Is there a problem with setting the variables ANDROID_STUDIO_JDK, JDK_HOME, and JAVA_HOME.

After some settings, shut down, restart, or cannot be opened. Online Search, du Niang is not powerful, or g brother, because it is a new thing, there are not many related content on the Internet, just found on StackOverflow, and it is also the same as the problem I encountered, I don't believe that JDK 1.6 requires JDK 1.7. It has been so long and is not supported yet. Programmers have a more frustrated heart, the more difficult the more they want to forward.

Finally, I found a bat file in the bin directory under the installation directory: studio. bat. When I opened it, I realized that there must be a problem with the environment variable settings. Please refer to the content of studio. bat:

@ ECHO OFF

::----------------------------------------------------------------------
: Android Studio startup script.
::----------------------------------------------------------------------

::---------------------------------------------------------------------
: Locate a JDK installation directory which will be used to run the IDE.
: Try (in order): ANDROID_STUDIO_JDK,... \ jre, JDK_HOME, JAVA_HOME.
::---------------------------------------------------------------------
If exist "% ANDROID_STUDIO_JDK %" set jdk = % ANDROID_STUDIO_JDK %
SET ADNROID_STUDION_JDK <strong>: I added this sentence. The variables are printed for testing, echo for linux, and set for win. </strong>
If not "% JDK %" = "" GOTO jdk
If exist "% ~ Dp0 \ .. \ jre "set jdk = % ~ Dp0 \ .. \ jre
If not "% JDK %" = "" GOTO jdk
If exist "% JDK_HOME %" set jdk = % JDK_HOME %
SET JDK_HOME
If not "% JDK %" = "" GOTO jdk
If exist "% JAVA_HOME %" set jdk = % JAVA_HOME %
SET JAVA_HOME <strong>: I added this sentence. The variables are printed out for testing. echo is used for linux and set is used for win. </strong>
IF "% JDK %" = "" GOTO error

: Jdk
SET JAVA_EXE = % JDK % \ bin \ java.exe
If not exist "% JAVA_EXE %" SET JAVA_EXE = % JDK % \ jre \ bin \ java.exe
If not exist "% JAVA_EXE %" GOTO error

Set jre = % JDK %
If exist "% JRE % \ jre" set jre = % JDK % \ jre
Set bits =
If exist "% JRE % \ lib \ amd64" set bits = 64

::---------------------------------------------------------------------
: Ensure IDE_HOME points to the directory where the IDE is installed.
::---------------------------------------------------------------------
SET IDE_BIN_DIR = % ~ Dp0
SET IDE_HOME = % IDE_BIN_DIR % \..

SET MAIN_CLASS_NAME = % ANDROID_STUDIO_MAIN_CLASS_NAME %
IF "% MAIN_CLASS_NAME %" = "" SET MAIN_CLASS_NAME = com. intellij. idea. Main

If not "% ANDROID_STUDIO_PROPERTIES %" = "" SET IDE_PROPERTIES_PROPERTY = "-Didea. properties. file = % ANDROID_STUDIO_PROPERTIES %"
SET IDE_HOME <strong>: I added this sentence. The variables are printed for testing. echo is used for linux and set for win. </strong>
SET MAIN_CLASS_NAME <strong >:: I added this sentence. The variables are printed for testing, echo for linux, and set for win. </strong>
::---------------------------------------------------------------------
: Collect JVM options and properties.
::---------------------------------------------------------------------
SET VM_OPTIONS_FILE = % IDE_BIN_DIR % \ studio=bits0000.exe. vmoptions
Set acc =
FOR/F "usebackq delims =" % I IN ("% VM_OPTIONS_FILE %") do call "% IDE_BIN_DIR % \ append. bat" "% I"
If exist "% VM_OPTIONS_FILE %" set acc = % ACC %-Djb. vmOptionsFile = "% VM_OPTIONS_FILE %"

SET COMMON_JVM_ARGS = "-Xbootclasspath/a: % IDE_HOME %/lib/boot. jar"-Didea. paths. selector = AndroidStudioPreview % IDE_PROPERTIES_PROPERTY %
SET IDE_JVM_ARGS =-Didea. platform. prefix = AndroidStudio
SET ALL_JVM_ARGS = % ACC % COMMON_JVM_ARGS % IDE_JVM_ARGS % REQUIRED_JVM_ARGS %

SET CLASS_PATH = % IDE_HOME % \ lib \ bootstrap. jar
SET CLASS_PATH = % CLASS_PATH %; % IDE_HOME % \ lib \ extensions. jar
SET CLASS_PATH = % CLASS_PATH %; % IDE_HOME % \ lib \ util. jar
SET CLASS_PATH = % CLASS_PATH %; % IDE_HOME % \ lib \ jdom. jar
SET CLASS_PATH = % CLASS_PATH %; % IDE_HOME % \ lib \ log4j. jar
SET CLASS_PATH = % CLASS_PATH %; % IDE_HOME % \ lib \ trove4j. jar
SET CLASS_PATH = % CLASS_PATH %; % IDE_HOME % \ lib \ jna. jar
SET CLASS_PATH = % CLASS_PATH %; % JDK % \ lib \ tools. jar
If not "% ANDROID_STUDIO_CLASS_PATH %" = "SET CLASS_PATH = % CLASS_PATH %; % ANDROID_STUDIO_CLASS_PATH %

::---------------------------------------------------------------------
: Run the IDE.
::---------------------------------------------------------------------
SET OLD_PATH = % PATH %
Set path = % IDE_BIN_DIR %; % PATH %
SET PATH
"% JAVA_EXE %" % ALL_JVM_ARGS %-cp "% CLASS_PATH %" % MAIN_CLASS_NAME % *

Set path = % OLD_PATH %
GOTO end

: Error <strong >:: check. The error message is displayed here. </strong>
Echo error: cannot start Android Studio.
ECHO No JDK found. Please validate either ANDROID_STUDIO_JDK, JDK_HOME or JAVA_HOME points to valid JDK installation.
ECHO
PAUSE
: End

Everything is caused by the setting of environment variables. see why. In addition, it should be noted that the sdk must be upgraded to version 22 before it can be used. This is not clear (as I have not explained on the official website) because it has been upgraded to the new version before it is installed, if not, upgrade it. My three environment variables are set as follows (three variables are set for the sake of insurance ):

JAVA_HOME: D: \ jdk \ bin; D: \ jdk \ jre \ bin; D: \ jdk \ lib \ tools. jar; D: \ jdk \ lib \ dt. jar;

JDK_HOME: D: \ jdk \; D: \ jdk \ bin; D: \ jdk \ jre \ bin;

ANDROID_STUDIO_JDK: D: \ jdk

I hope you can help me try new things. It's not well written. Please don't scold me. Besides, I have a 64-bit Win7 system. Good luck to everyone.

More about Android Studio: http://www.bkjia.com/search.aspx? Where = nkey & keyword = 21639

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.