-1

I am trying to install android sdk through command line tools, in most of the tutorials it says that I should run android.bat from tools folder but cmd opens and then closes after a second or two, so I tried with the sdkmanager.bat from tools\bin\sdkmanager.bat but the same happens. I googled and found some information so I tried running it from cmd, android.bat is deprecated it says, but when running sdkmanager.bat or avdmanager.bat it gives me an error: JAVA_HOME is not set

Here is the screenshot: error message from cmd

I tried following the steps as in: How to set java_home on Windows 7?

But after I did it and tried running it again in cmd, my problem is now this: Second error after setting up JAVA_HOME

Community
  • 1
  • 1

1 Answers1

0

To Set JAVA_HOME in Windows:

  1. Right click My Computer and select Properties.

  2. On the Advanced tab, select Environment Variables, and then edit JAVA_HOME to point to where the JDK software is located, for example, C:\Program Files\Java\jdk1.8.0_161\

  3. If you don't have JDK software. Go to http://java.sun.com/javase/downloads/index.jsp. Select the appropriate JDK software and click Download.
Sathish
  • 21
  • 4
  • There was no JAVA_HOME variable so I created one with the directory C:\Program Files\Java\jdk-10.0.1 I'm not sure if this is the right way to do it, probably not, but anyways, this is what pops up now after entering the same command https://imgur.com/t1ztPaz – Mateo Cuković Jun 22 '18 at 17:14