36

I have installed JDK 1.0.7_25 and Android Studio bundle as instructed. After completing the installation when I tried to launch, I got the following error message:

Failed to load JVM DLL C:\Program Files\Java\jdk1.7.0_25\jre
If you already have a 32-bit JDK installed, define a JAVA_HOME variable in Computer > System Properties > System Settings > Environment Variables.

I have created a JAVA_HOME variable as prescribed, but still getting the same error message. Now I'm a little frustrated about this. Please help me out. It will be very helpful if you can give me a step-by-step solution as I am new in this area.

Lloyd Dominic
  • 778
  • 8
  • 25
Mayeed
  • 691
  • 1
  • 7
  • 19

19 Answers19

64

It is very late for my answer but still to the people who reference this in the future, I had the same issue. Mine was x64 bit OS and I was trying to open studio.exe which is x32 bit. I opened studio64.exe and it worked.

SDJ
  • 899
  • 1
  • 7
  • 14
34

As well as JAVA_HOME which should be set to the jdk directory e.g. C:\Program Files\Java\jdk1.7.0_21 you also have to add a path to the jdk bin directory e.g. C:\Program Files\Java\jdk1.7.0_21\bin. As you already know how to set the JAVA_HOME variable adding the extra directory to the path variable is just the same but you have to edit an existing variable and add the path separated by a semicolon e.g. add ;C:\Program Files\Java\jdk1.7.0_21\bin to the end of the path. And then restart your PC, to start the Android Studio. More details at: Getting Started With Android Studio

Harsha Biyani
  • 7,049
  • 9
  • 37
  • 61
Mike James
  • 749
  • 6
  • 9
  • I've added this path but it still doesn't works. but after installing this(https://adoptium.net/download/) it works fine – mustafa-hsz Feb 01 '23 at 22:10
32

It works like this:

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

and

PATH: C:\Program Files\Java\jdk1.7.0_21\bin

Harsha Biyani
  • 7,049
  • 9
  • 37
  • 61
user2675991
  • 321
  • 2
  • 3
17

I hit this with a fresh install of Android Studio on Windows 10. It ran fine after installing, but gave this error after I rebooted the computer. Turns out I need to run Android Studio with Administrator privileges, which doesn't happen by default.

Right-click --> Run as Administrator

If this is not viable, there is probably a different approach which would involve installing the JDK in a location that runable without elevated permissions (see other answers for ideas).

Aaron C
  • 3,328
  • 1
  • 24
  • 22
13

If you are running a 64-bit version of Windows, you should run the 64-bit executable, studio64.exe.

Try to run studio64.exe with Administrator privileges. (C:\Program Files\Android\Android Studio\bin)

Reference: Android Studio does not start

Salman khan
  • 1,135
  • 10
  • 17
9

I waste my two days for this issue. I resolved this issue by installing Microsoft Visual C++.

In windows Operating System. Install Microsoft Visual C++ X86 or X64.

Manoj Kumar
  • 307
  • 2
  • 7
  • 13
4

I faced this issue when updating to Android Studio Electric Eel. It happens when you have two different instances of JDK, one you installed in your system and the other one comes with android studio.

Just delete the folder jbr from the Android Studio directory, which will fix the issue, and use the default JAVA_HOME path.

Atiq
  • 14,435
  • 6
  • 54
  • 69
  • After adding the JAVA_HOME and path variables, I was still getting the same error. This step worked for me. However, now I'm getting an error when I load AS: java.lang.Error: Incomplete or corrupted installation - "C:\Program Files\Android\Android Studio\jbr" directory does not exist I haven't played around yet to see if this causes other problems. – Derrick Jan 21 '23 at 21:35
3

For me it helped to make sure that I ended my environment variables with a backslash

JAVA_HOME = C:\path to jdk\

PATH = C:\other existing paths\;C:\path to jdk\bin\

John Masiello
  • 149
  • 1
  • 4
3

I added JAVA_HOME = C:\Program Files\Java\jdk-10.0.1. And Open Android Studio as run as administrator. Worked for me.

Harsha Biyani
  • 7,049
  • 9
  • 37
  • 61
Atif Mukhtiar
  • 1,186
  • 9
  • 11
2

This issue happen due to two reasons

  1. You don't have JDK in program files.
  2. You didn't add path of JDK in environment variable.

Go to ( C: \Program Files ) and search for java folder if it isn't exist then go to this link and download latest JDK for window, mac or Linux and install it on default location.

https://www.oracle.com/java/technologies/downloads/#jdk19-windows

If java folder already exists and it has jdk in it then search for environment variable in PC search-bar and open it. Add JDK and bin path like this:

enter image description here

enter image description here

enter image description here

1

It is very simple![step-1][1]..Just go to Advanced settings>environment variables.In System variables,add new variable(JAVA_HOME) by clicking new.Fill the variable value by the location of the jdk-"C:\Program Files\Java\jdk1.7.0_75" in program variable .

In next step you have to edit the existing System Variables by scrolling down to find "path: There are already so many path values defined in variable values.So by using ";" you can add another value as ";C:\Program Files\Java\jdk1.7.0_75\bin".

Check it out.it is ready.All the best.

1

Restart was not necessary. It worked.

JAVA_HOME: C:\Program Files\Java\jdk1.8.0_201\jre\bin\server\jvm.dll 

and

PATH: C:\Program Files\Java\jdk1.8.0_201\bin
dp2050
  • 332
  • 3
  • 8
0

Just to be sure,ensure that your java version is enabled in the Java controll Panel,sometimes it does conflict and the android studio fails to pick since the one Enabled is not on the Classpath.Make sure that the one Enabled is the one that is set in the Class Path/Environmenal Variables.

Java control Pane

java Contrl Panel2

Happy Coding!

Fred Ondieki
  • 2,314
  • 25
  • 23
0

I had to do nothing except rebooting my pc. After reboot it worked.

Tien Do Nam
  • 3,630
  • 3
  • 15
  • 30
0

In my case Just run it as Admin and it will work

Aryan Tech
  • 13
  • 3
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-ask). – Community Sep 22 '21 at 06:42
0

Thanks for the above answers. But It didn't helped me to solve my problem. Solution : Delete the jre folder. Path for jre : C:\Program Files\Android\Android Studio\jre

Hitesh Sarsava
  • 666
  • 4
  • 15
0

After installing Windows 10, I attempted to install Android Studio and ran into this issue.

Nothing worked for me despite numerous attempts and the setting up of the JAVA_HOME environment variable.

So, I tried deleting jvm.dll from C: Program Files/Android/Android Studio/jbr/bin/server (The location where your jvm.dll is located as per the error message box). and restarting my computer, my issue was resolved.

You can save a copy of the jvm.dll file just in case you decide against using my method.

I might advise you to try it. I sincerely hope that my solution will enable you to solve this issue.

Happy programming!

Saurav Gawali
  • 21
  • 1
  • 3
0

I was not able to run on Android Studio version 2022.1.1 Electric Eel even after install jdk 19 separately, or running the studio64.exe, or running with admin priviledge.

My solution: Installing Android Studio version 2021.2.1 Chipmunk works for me.

Tri
  • 199
  • 9
0

Mine was giving me similar. I solved it as follows.

  1. Install jdk_19_windows-x64_bin.
  2. Set environment variables , System variables JAVA_HOME to C:\Program Files\Java\jdk-19 and path to C:\Program Files\Java\jdk-19\bin
  3. Then installed Android Studio electric eel 2022.1.1.19-windows. Am now enjoying the new features. No need to restart the computer.