Search code examples
androidandroid-sdk-toolsandroid-sdk-manager

Not able to execute sdk manager commands from command line : Android


I am not able to execute the sdkmanager from command line. if I execute ./sdkmanager --list, I got following exception

Error: Could not find or load main class java.se.ee

Any help on this?


Solution

  • I have solved my issue by removing -XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee in the sdkmanager

    It was originally

    # Add default JVM options here. You can also use JAVA_OPTS and SDKMANAGER_OPTS to pass JVM options to this script.
    DEFAULT_JVM_OPTS='"-Dcom.android.sdklib.toolsdir=$APP_HOME" -XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
    

    and I removed -XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee.

    Now I can run sdkmanager commands