Android Device Monitor dependency on legacy Java SE 6 runtime
Asked Answered
I

2

10

With Android Studio v2.2, the DDMS is deprecated in favor of Android Device Monitor. But when I try to open the Monitor, it doesn't open citing that it is dependant on legacy Java SE 6 runtime which in missing in my Mac Os Sierra. This is crazy, isn't it?

I want to try mocking incoming SMS, phone calls to the emulator from the monitor. And this monitor doesn't work with jdk 7/8. What is the way out??

Innerve answered 13/1, 2017 at 13:20 Comment(0)
N
4

I am going to extend a bit more @karthiks's answer.

Probably you are in the situation where you have installed the latest version of the JDK, but you need JDK6 in order to use Android Device Monitor. The following steps allow you to keep your latest JDK as default, but define JDK6 for the directory where ADM is located.

  1. Install the legacy JDK6.
  2. Install jEnv:
    $ brew install jenv
  3. Add jEnv to the PATH:
    $ echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bash_profile
    $ echo 'eval "$(jenv init -)"' >> ~/.bash_profile
  4. Reload .bash_profile:
    $ source ~/.bash_profile
  5. Add your latest JDK to jEnv (in my case 1.8.0_131):
    $ jenv add /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/
  6. Add JDK6 to jEnv:
    $ jenv add /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
  7. Define JDK6 for the directory where Android Device Monitor is located:
    $ cd ~/Library/Android/sdk/tools/
    $ jenv local 1.6
Ninth answered 17/7, 2017 at 17:4 Comment(1)
Between steps 3 and 4 I would add: source ~/.bash_profileBlimp
I
1

I realised that the only way out of this is to install the legacy JDK6 in your mac. You can download it from Apple Support only.

You then have this worry of what happens to the latest JDK(/JRE) installed in your OS? The way I manage it is via JENV on command line.

Peace!

Innerve answered 9/6, 2017 at 19:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.