Android Studio installation on Windows 7 fails, no JDK found

后端 未结 29 1714
鱼传尺愫
鱼传尺愫 2020-11-22 04:48

I downloaded Android Studio and attempted to launch the program.

This is running on Windows 7 64-bit with Java 1.7. During the installation my Java 1.7 is detected,

相关标签:
29条回答
  • 2020-11-22 05:24

    With the last update of Androd Studio I have two versions of the IDE's launcher

    One is called studio.exe and the other studio64.exe they are both on:

    C:\Users\myUserName\AppData\Local\Android\android-studio\bin
    

    You have to launch the one that matches your Java version 64 or 32 bit

    0 讨论(0)
  • 2020-11-22 05:24

    I got the problem that the installation stopped by "$(^name) has stopped working" error. I have installed Java SE Development kit already, also set both SDK_HOME and JAVA_HOME that point to "C:\Program Files\Java\jdk1.7.0_21\"

    My laptop installed with Windows 7 64 bits

    So I tried to install the 32 bit version of Java SE Developement kit, set my JAVA_HOME to "C:\Program Files (x86)\Java\jdk1.7.0_21", restart and the installation worked OK.

    0 讨论(0)
  • 2020-11-22 05:26

    OK, I figured out how fix this nasty bug.

    Before you start

    Go to your Android Studio installation folder and locate the bin folder. Inside the bin folder, you will find studio.bat. Execute the file, and it'll show the error. If it is about the Java path then follow the tip 1.

    Tip 1

    When you set the path JAVA_HOME, etc., make sure not to include bin at the end of the path. This solved the issue for me.

    JAVA_HOME => C:\Program Files\Java\jdk1.7.0_21

    path => C:\Program Files\Java\jdk1.7.0_21\bin

    It works fine with JDK 1.7 (I tried with 32 bit).

    If you do so, you can see the initial screen as below.

    Enter image description here

    Tip 2

    Are you getting the below error message?

    Your Android SDK is out of date or is missing templates. Please ensure you are using SDK version 22 or later.

    This error probably occurs, because you have reference to your older SDK (that you downloaded with Eclipse) in your path variable. Go to Environment variables and remove any reference to the old SDK folder and point it to new SDK folder that is found inside the Android Studio installation folder.

    Save and restart Studio, things should work as expected now.

    Tip 3

    If you hate messing around with the path variable as given above by removing old references, simply follow the following steps to refer to new SDK path that comes with Studio.

    *Project Defaults* -> *Project Structure* -> Click "New" -> Select "Android SDK" -> Select the SDK folder inside the studio installation.

    0 讨论(0)
  • 2020-11-22 05:26

    My issue was caused because I have an & character in my Windows user name, so when installed in the default path I was getting the following error after running bin/studio.bat

                                                   |
                                                   v notice broken path
    The system cannot find the file C:\Users\Daniel \studio64.exe.vmoptions.
    Exception in thread "main" java.lang.NoClassDefFoundError: com/intellij/idea/Main
    Caused by: java.lang.ClassNotFoundException: com.intellij.idea.Main
            at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    Could not find the main class: com.intellij.idea.Main.  Program will exit.
    

    So I uninstalled and reinstalled it to program files and it launches fine now.

    0 讨论(0)
  • 2020-11-22 05:26

    I couldn't get this to work no matter which environment variables I set. So I simply put a copy of the JDK into my Android Studio installation folder.

    1. Copy the contents of the JDK installation (for example, C:\Program Files (x86)\Java\jdk1.7.0_21)

    2. Paste them into the installation directory of the Android Studio (for example, C:\Program Files (x86)\Android\android-studio)

    I somewhat assumed that the issue was caused by having the x64 version of the JDK installed. But what was especially confusing was the fact that I could start Android Studio just fine when I started the studio.bat as an Administrator (even though the environment variables were set for my personal user account).

    studio.bat will look for several valid options when determining which JDK to use.

    :: Locate a JDK installation directory which will be used to run the IDE. :: Try (in order): ANDROID_STUDIO_JDK, ..\jre, JDK_HOME, JAVA_HOME.

    As explained above, I picked the ..\jre option.

    0 讨论(0)
  • 2020-11-22 05:26

    Windows 64 bit, JDK 64 bit (Solution that worked for me) Tried all the above solutions, None of them worked, I have been trying to solve it from past few days and now i done it successfully.For me the problem was, when i first installed Android Studio my JDK version was 1.7, then after installing i updated the JDK to 1.8,then i removed old JDK folder and everything was messed up, even uninstalling and reinstalling android studio randomly didn't solved the issue.

    Below is the solution that worked for me

    1) Uninstall Android Studio.

    2) clean temp files and android studio C:\Users\Username.AndroidStudio1.5

    3) Uninstall JDK.

    4) Now without JDK try to install Android Studio and now it will show message that it cant find any JDK. Stop installation

    5) Install JDK 1.7 or 1.8 (Set JAVA_HOME,JDK_HOME,path Environment variables as explained by everybody above)

    6) Install Android Studio.

    7) Done. Enjoy and happy coding.

    0 讨论(0)
提交回复
热议问题