Android studio doesn't start

前端 未结 16 2650
误落风尘
误落风尘 2020-12-17 08:38

I just download Android Studio for Windows 7, the wizard went ok up to the end but now when I click on the shortcut or on the .exe to start the program nothing happens, no e

16条回答
  •  悲&欢浪女
    2020-12-17 08:53

    If your path and/or environment variables are not pointing to the correct JDK, things won't work properly.

    A rock solid solution, especially if you must have multiple JDKs installed (e.g. Java 6/7/8) is to create a batch file to launch Android Studio.

    Create a new file called studio.bat and place this somewhere outside the Android Studio installation, e.g.

    c:\mydevstuff\launchers\studio.bat
    

    (if you put the batch file anywhere in the android-studio folder, then you'll have problems when updating Android Studio).

    Put the following code in the new batch file:

    @echo off
    
    REM Can make paths relative to SCRIPT_PATH if necessary
    set SCRIPT_PATH=%~dp0
    
    set ANDROID_STUDIO_JDK=
    set JAVA_HOME=
    set PATH=\bin;%PATH%
    cd \bin
    start studio64.exe
    

    Replace studio64.exe with studio.exe if you need the 32-bit version.

    Replace

     
    

    with the path to your JDK, e.g.

    C:\Program Files\Java\jdk1.7.0_25
    

    Replace

    
    

    with the path to your Android Studio installation, e.g.

    C:\Program Files\Android\android-studio
    

    Now you can just run the batch file to start Android Studio.

    Additional: If you want to pin to the Taskbar, then create a shortcut to the batch file and then change it's target to:

    cmd.exe /c "\studio.bat"
    

    Then pin this shortcut to the Taskbar by drag-and-drop.

    You can also set it's icon from the original Android Studio studio.exe file.

提交回复
热议问题