-
-
Save yehgdotnet/36253b850b59cc0f379f6d8cb00bcce4 to your computer and use it in GitHub Desktop.
[Android-SDK | Java9 incompatibility fix - MacOS X] remove Java 9 and install Java 8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ avdmanager | |
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema | |
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156) | |
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75) | |
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81) | |
at com.android.sdklib.tool.AvdManagerCli.run(AvdManagerCli.java:213) | |
at com.android.sdklib.tool.AvdManagerCli.main(AvdManagerCli.java:200) | |
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema | |
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582) | |
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185) | |
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496) | |
... 5 more | |
$ sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9*.jdk/ | |
$ sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin | |
$ sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane | |
$ /usr/libexec/java_home -V | |
Unable to find any JVMs matching version "(null)". | |
Matching Java Virtual Machines (0): | |
Default Java Virtual Machines (0): | |
No Java runtime present, try --request to install | |
$ brew tap caskroom/versions | |
$ brew cask install java8 | |
$ touch ~/.android/repositories.cfg | |
$ brew cask install android-sdk | |
$ echo 'export ANDROID_SDK_ROOT="/usr/local/share/android-sdk"' >> ~/.bash_profile | |
$ java -version | |
java version "1.8.0_162" | |
Java(TM) SE Runtime Environment (build 1.8.0_162-b12) | |
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode) | |
$ avdmanager | |
Usage: | |
avdmanager [global options] [action] [action options] | |
Global options: | |
-s --silent : Silent mode, shows errors only. | |
-v --verbose : Verbose mode, shows errors, warnings and all messages. | |
--clear-cache: Clear the SDK Manager repository manifest cache. | |
-h --help : Help on a specific command. | |
Valid actions are composed of a verb and an optional direct object: | |
- list : Lists existing targets or virtual devices. | |
- list avd : Lists existing Android Virtual Devices. | |
- list target : Lists existing targets. | |
- list device : Lists existing devices. | |
- create avd : Creates a new Android Virtual Device. | |
- move avd : Moves or renames an Android Virtual Device. | |
- delete avd : Deletes an Android Virtual Device. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment