0
votes

I would like to enjoy SDK Android tools without downloading and installing Android Studio on my Windows 7 64. I have Java version:

java version "1.8.0_241"

Java(TM) SE Runtime Environment (build 1.8.0_241-b07)

Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)

It is obviously possible as explained on the official page:

https://developer.android.com/studio/index.html#command-tools

So I download and extract this zip 'commandlinetools-win-6200805_latest.zip' to my folder:

 C:\Program Files\Android

And I get a subfolder 'tools' inside my folder :

C:\Program Files\Android\tools

which contain other subfolders 'bin' and 'lib'.

When I run in command line 'sdkmanager' (located in 'bin' folder), I get this error message:

Error: Unable to find or load the main class Files\Android\tools\bin\\

!!! The message is in French and I translated it !!! So please forgive me if it is not 100% accurate. I can't reproduce the error message in English as my OS is in French.

There are no guidelines or README or tutorial about the process to download and install this Android SDK package. I guess because it supposes to work.

I've seen a lot of issues like this but these issues are coming from different scenarios for other purposes.

I couldn't find a solution to my problem.

Do you have any idea what am I missing here?

1

1 Answers

0
votes

After some investigation and tests, I found the answer. I will post here the guidelines for some newbie who would like to enjoy SDK Android without Studio on his machine.

  1. You must create a folder 'Android\cmdline-tools' in C:\Users\your_username\AppData\Local\Android\cmdline-tools
  2. Then you unzip the ZIP files in this folder.
  3. Then you will see a folder 'tools' inside your folder 'cmdlines-tools'. You rename it 'latest'.
  4. You add environment variable ANDROID_HOME=C:\Users\\AppData\Roaming\Android\cmdline-tools\latest
  5. You add to PATH environment variable this path : %ANDROID%\bin

Et voilà!

Don't forget to restart your command line to enjoy the new environment variable or to reboot your computer if necessary.

I have no idea why it must be located in this folder, why to rename the folder tools in the latest... But it works! If you're an expert, feel free to explain in comments or in new answer.