I'm trying to set up flutter on my Ubuntu 19.10 machine.
When I run flutter doctor --android-licenses
It prompts me to update the SDK like so -
A newer version of the Android SDK is required. To update, run:
/home/<username>/Android/SDK/tools/bin/sdkmanager --update
When I run it, I encounter an Exception - java.lang.NoClassDefFoundError
This answer suggests changing DEFAULT_JVM_OPTS
in sdkmanager
to
DEFAULT_JVM_OPTS='"-Dcom.android.sdklib.toolsdir=$APP_HOME" --add-modules java.xml.bind'
This seems to work in Java 9/10. However, I use Java 11 and unfortunately the java.xml.bind
module and java.se.ee
module has been discontinued from Java 11 -
java version "11.0.6" 2020-01-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.6+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.6+8-LTS, mixed mode)
Is there a way to fix this in Java 11? Or do I have to downgrade to Java 9/10?