Android Studio, define a JAVA_HOME variable

I saw a video on Youtube for enhancing the performance of Android Studio. I did and now I can’t launch my Android Studio. Now it gives an error saying that “If you already have a 64-bit JDK installed, define a JAVA_HOME variable in Computer > System Properties > System Settings Environment Variables. Failed to create JVM. JVM Path C:Program FilesAndroidAndroid Studiojrejre”

enter image description here

I searched the whole internet and tried every solution mentioned but I still get the “define JAVA_HOME variable” error. I tried both completely uninstalling the Android Studio with all files and related folders manually deleted but still get this error and Android Studio just won’t simply run. I have exams in a few days and I have a lot to practice.

Edit:

enter image description here

I just removed the JAVA_HOME. I have both the JDK and JVM installed. I am just uninstalling and installing Android Studio at the moment.

Edit 2:

enter image description here

Answer

Okay, so I found an answer after spending 5 hours fixingsetting Environment Variables (JAVA_HOME), uninstalling and reinstalling both the JDK and Android Studio.

The answer was simple. For any version of Android Studio that is >version 4.0, you need to remove the “studio.exe.vmoptions” or “studio64.exe.vmoptions” (depending on your system) from the directory “C:Users{Your Username}AppDataRoamingGoogle{Android Studio Version}”.

Leave a Reply

Your email address will not be published. Required fields are marked *