0

I'm trying to launch Android Studio (64-bit) by clicking the icon on my desktop.

When I use the studio.bat file to launch Android Studio - 64-bit AS launches and runs fine (however, the CMD window remains running in the background - if I close the CMD window, AS closes).

I had to modify the studio.bat file to reflect the appropriate location of my JDK Installation.

The part I modified looks like this (I had to manually set the location):

IF EXIST "%ANDROID_STUDIO_JDK%" SET JDK=%ANDROID_STUDIO_JDK%
IF NOT "%JDK%" == "" GOTO jdk
IF EXIST "%~dp0\..\jre" SET JDK=%~dp0\..\jre
IF NOT "%JDK%" == "" GOTO jdk
IF EXIST "%JDK_HOME%" SET JDK=%JDK_HOME%
IF NOT "%JDK%" == "" GOTO jdk
IF EXIST "%JAVA_HOME%" SET JDK=%JAVA_HOME%
SET JDK=D:\Program Files\Java\jdk1.7.0_67x64
IF "%JDK%" == "" GOTO error

I have added the appropriate environmental variables to my computer properties:

I have

JAVA_HOME D:\Program Files\Java\jdk1.7.0_67x64

When I open a CMD prompt and run 'set JAVA_HOME' it displays the appropriate location.

Now when I double click the Android Studio icon on the desktop it gives me the following error:

Failed to load JVM DLL D:\Program Files\Java\jdk1.7.0_67x64\jre.

If you already have a 64-bit JDK installed, define a JAVA_HOME variable in Computer >

> System Properties > System Settings > Environment Variable

s.

The problem is - I've already done that. For some weird reason - Windows just refuses to recognize that location despite me being able to see it registered appropriately under CMD prompt with 'set JAVA_HOME'.

Any ideas so I can just run this normally instead of having to open AS with the .bat file all the time? This has been nothing short of a nightmare.

I'm running Windows 7 Pro 64-bit.

All suggestions welcome.

Hanny
  • 2,078
  • 6
  • 24
  • 52

1 Answers1

0

Firstly if you have already set JAVA_HOME env variable, then you don't have to specify it in the bat file. So you can get rid of this line SET JDK=D:\Program Files\Java\jdk1.7.0_67x64 I don't have to specify jdk in my system and it works fine.

And secondly if you really want to mention it, then you have to put file path in quotes("") else it won't work since you have spaces in the file path.

Nishant Soni
  • 658
  • 1
  • 9
  • 19
  • Strange. It must have HATED the space - I tried every combination I could think of and nothing worked (including putting it in quotes). I just made a directory 'Java' on root D:\ and stuck appropriate subdirectories inside there and now it works like a charm (reinstalled the JDK to reflect it all appropriately. Strange. But thank you :) Guess those pesky spaces are still an issue. – Hanny Aug 10 '14 at 00:00