I installed android studio in windows 7 but it just closes immediately after opening. I've installed java jdk also and added a JDK_HOME environment variable But android studio closes itself after few seconds.
-
1i am facing the same issue,and i dont think any thing is wrong with the jdk path. – Sagar G. Jul 24 '15 at 08:51
-
Geez this question needs way MORE upvotes. Since I've updated to the latest Android Studio version is working like s!$t. I've been trying everything, use Oracle's JDK, use the default JRE wrapper, change the Gradle settings. The most annoying thing is that it just closes, I don't see any error nor log. – 4gus71n Feb 28 '19 at 17:50
-
Same here and it's not from jdk. – FarshiD Naqizadeh May 25 '23 at 19:59
3 Answers
Figured it out! I'm sure someone will run into this in the future, so here goes.
Even though it found my JDK during installation, it wasn't able to find it when I was trying to open it, for some reason. Simple fix. Add a JDK_HOME environment variable to your system variables. It should contain the path to your JDK's ROOT directory. i.e. c:\Program Files\Java\jdk1.7.0_21\
source link
Answer-2
see this link also link2

- 1
- 1

- 721
- 1
- 7
- 28
-
4I have done that. But android studio does open but closes automatically after few seconds. – Brock Jul 21 '15 at 07:15
-
1follow the link 2 so that you can understand where the error occurred. and tell the exact problem so that we can assist – Bala Saikrupa Puram Jul 21 '15 at 07:16
-
Running Windows 10 on a 64 bit, I shutdown and restarted. Problem went away. – Charles Haughey Nov 30 '20 at 15:10
I have two versions of JDK installed on my computer and get the same problem. x64: C:\Program Files\Java\jdk1.8.0_91 x86: C:\Program Files (x86)\Java\jdk1.7.0_55
Solved by pointing the JDK_HOME to x86 path.

- 921
- 1
- 12
- 30
For me it was changing the gradle version which caused this because of a known bug, I commented here on what worked for me but I recommend you read through the whole thing

- 254
- 4
- 8