3
votes

I'm trying to install Android SDK (not Studio) following this tutorial - https://linoxide.com/linux-how-to/install-android-sdk-manager-ubuntu/

When running sdkmanager --list I was getting the following 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)

So amended the file ~/android-sdk-tools/bin/sdkmanager and amended the following line to be:

DEFAULT_JVM_OPTS='"-Dcom.android.sdklib.toolsdir=$APP_HOME" -XX:+IgnoreUnre    cognizedVMOptions --add-modules java.se.ee'

Now the error doesn't show, but when I run sdkmanager --list it just hangs without any response.

If it helps, here's my versions of java etc:

$ java -version
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.2)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.2, mixed mode)
$ javac -version
javac 10.0.2
1

1 Answers

1
votes

Java version 9 and 10 are not supported for android sdk, downgrade your java version 8 or less.