Android Device Monitor will not launch, either from Android Studio or from Terminal -- UnsupportedClassVersionError
I'm having the same issue. Based on the log file, the new version of Android Studio requires Java 8 "Unsupported major.minor version 52.0": Unsupported major.minor version 52.0
I'm running Linux, I currently have java8 installed so I just needed to use:
update-alternatives --config java
and
update-alternatives --config javac
then everything worked.
It looks as though you're using a Mac, so you may or may not need to do the following after installing Java 8: Installed Java 7 on Mac OS X but Terminal is still using version 6
Info from Unsupported major.minor version 52.0 source: wikipedia
- J2SE 8 = 52
- J2SE 7 = 51
- J2SE 6.0 = 50
- J2SE 5.0 = 49
- JDK 1.4 = 48
- JDK 1.3 = 47
- JDK 1.2 = 46
- JDK 1.1 = 45
Confusingly I didn't have Java 8 installed in a shared location (only the bundled version in Android Studio). Installing it through homebrew solved my problem.
brew cask install java
$ java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
Android Studio comes with built-in Java 1.8, so it wasn't a problem when you are developing android app. But when you launch Android Device Monitor, it uses external java compiler that run on your OS. If you have preinstalled Java before, it won't be a problem. Otherwise, you will face the same problem.
I tried to set JAVA_HOME path to java packed in Android Studio. It does not work, probably because it is openjdk version.
My solution was to download Java JDK 1.8 from Oracle and install in my computer.