4

I can't open the monitor (ddms) in android studio getting following error:

A java Runtime Environment (JRE) or Java Development kit (JDK) must be available in order to run Monitor. No Java virtual machine was found after searching the following locations: C:\Android-Studio\android-studio\sdk\tools\lib\monitor-x86\jre\bin\javaw.exe javaw.exe in your current PATH

Would appreciate any suggestion how to fix this. thanks

Udi Oshi
  • 6,787
  • 7
  • 47
  • 65
  • Same issue : http://stackoverflow.com/questions/26055531/android-studio-monitor-exe-has-stopped-working/26056751#26056751 – TooCool Sep 26 '14 at 09:56

4 Answers4

5

You must have your jdk or jre installed and in your path. Considering you are running windows you must go to your environment variables and add the location of one of them to the path. That is assuming you already have one of them installed. If you dont you need to go the oracle website and get one of them.

If you already have it installed go to your systems settings, then go to the advanced settings tab and click Environment variables at the bottom, there you edit the PATH and add the location of your jre or jdk, that should solver your problem.

Gabriel Netto
  • 1,818
  • 1
  • 16
  • 26
  • JDK was already installed. notice that the android studio IDE looking for the JRE in its own sub-folder /sdk/tools/lib/monitor-x86/JRE. Found a nasty workaround - copied the jre folder from my program files/java/jdk into that folder....works great but not the optimal solution, maybe is there another way to point the studio to the jre folder? – Udi Oshi May 19 '13 at 14:47
  • 1
    Just set include the bin folder for the jre and the jdk to the windows path and it should be fine. – Gabriel Netto May 19 '13 at 20:19
0

I'm trying adding my JRE path to PATH on Environment variables but doesn't work. Even I try making symbolic link (directories) C:\Android-Studio\android-studio\sdk\tools\lib\monitor-x86\jre\bin\ with C:\Program Files\Java\jre7\bin but doesn't work.

I found a solution and I this is is because Android Studio is updated but SDK Tools don't.

In my case I manually update AS from 0.8.6 to 0.8.12 manually (because updater in 0.8.6 are buggy), but not update SDK Tools.

Finally I update SDK using this post: Can't upgrade Android SDK Tools Can't upgrade Android SDK Tools

Now I have Android Studio (0.8.12) and SDK Tools (23.0.5) ... DDMS open again. :D

Community
  • 1
  • 1
equiman
  • 7,810
  • 2
  • 45
  • 47
0

Monitor is an eclipse RCP, so you can edit ini file to set JRE(or JDK) path.

for example:

A java Runtime Environment (JRE) or Java Development kit (JDK) must be available in order to run Monitor. No Java virtual machine was found after searching the following locations: C:\Android-Studio\android-studio\sdk\tools\lib\monitor-x86\jre\bin\javaw.exe javaw.exe in your current PATH

In this case, your monitor is located in "C:\Android-Studio\android-studio\sdk\tools\lib\monitor-x86". navigate to that path and edit monitor.ini file.

Add follwing line: -vm [your JRE path]

finejustice
  • 413
  • 2
  • 9
0

Here is what I did in a few steps:

NB: Make sure the PATH of the location of your jre or jdk is set in your Environment Variables before you do these steps

  1. Close the error dialog box
  2. Copy JRE folder from Android folder in Program Files, for me it is C:\Program Files\Android\Android Studio
  3. And paste this JRE folder in your Android SDK monitor-x86_64 location, for me, it is C:\AndroidSdk\tools\lib\monitor-x86_64
  4. Run the Android Device Monitor again

Hope it's fixed, if not, restart your Android Studio

Brian
  • 406
  • 1
  • 5
  • 8