简体   繁体   中英

Android Device Monitor not opening in Ubuntu 17.10

When I open Android Device monitor, I am getting the following error:

An error has occurred. See the log file
/home/omkar/Android/Sdk/tools/lib/monitor-x86_64/configuration/1509852867579.log.

I have already tried:

  1. Running Android studio with "sudo"/ root user permission.
  2. Reinstalling Android SDK.

My configuration :

  1. Android Studio 3.0
  2. Android SDK API version 27.
  3. Ubuntu 17.10 Gnome

I am attaching the pastebin link for the logs in the question. Logs Link : https://pastebin.com/cje8fkgY

While Android Studio brings its own Java version with it, the (now mostly deprecated) Android Device Monitor (ADM) is dependent on the Java version installed on your machine. From other error reports around the web, it seems that ADM needs Java 8 ( here , for example). This is also where our machines differ from each other. As I noted in a comment above, I am, too, on Ubuntu 17.10, Android Sdk 27 and Android Studio 3.0, however, I have Java 8 installed, and ADM runs fine.

Therefore I would suggest you to add Java 8 to your machine and make it the default version. On Ubuntu, you can do this like that:

sudo add-apt-repository ppa:webupd8team/java // only necessary if repository not yet added
sudo apt-get update                          // only necessary if repository not yet added

sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default

You need to set the default Java version. To do this follow below steps:

Run:

sudo  update-java-alternatives --list

to list off all the Java installations on a machine by name and directory, and then run:

sudo  update-java-alternatives --set [JDK/JRE name e.g. java-1.8.0-openjdk-amd64]

This worked perfectly for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM