title: Fix sdkmanager java.lang.NoClassDefFoundError batchfile
body: <p>I get an error trying to run <code>sdkmanager</code></p>
  <pre class="lang-none prettyprint-override"><code>Exception in thread &quot;main&quot; java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
          at com.android.repository.api.SchemaModule$SchemaModuleVersion.&lt;init&gt;(SchemaModule.java:156)
          at com.android.repository.api.SchemaModule.&lt;init&gt;(SchemaModule.java:75)
          at com.android.sdklib.repository.AndroidSdkHandler.&lt;clinit&gt;(AndroidSdkHandler.java:81)
          at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
          at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
  Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
          at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
          at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
          at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
          ... 5 more
  </code></pre>
  <p>How can I fix this as I have tried changing to Java 7, 8 and 10, but none is working.</p>