I use the command line to develop Android apps, so I need to use the command line SDK tools. Whenever I run sdkmanager.bat or avdmanager.bat from the command line, I always get this error :
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:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 5 more
I have seen in many posts that these tools need Java 8 and that's what causing the error. I had also tried the tweaks to the sdkmanager.bat file mentioned in those posts, but then I get java.se.ee module not found
.
So, I need to manually install the required tools such as the platform tools and system images directly from the actual website without using the sdkmanager. Can anyone help me on how to do this?
The post at How to install Android SDK Build Tools on the command line? didn't help me in any way.