1
votes

I am a newbie for nativescript. I am trying to configure envirnoment for Android development following this link. While trying to configure jdk it stucks forever. I have tried installing jdk manullay as well. But tns doctor command still gives this error Error executing command 'javac'. Make sure you have installed The Java Development Kit (JDK) and set JAVA_HOME environment variable. and this warning × WARNING: The Java Development Kit (JDK) is not installed or is not configured properly.

Any help?

4

4 Answers

1
votes

Apparently, tns android only works with 1.8.0_152. I had 1.8.0_191 and spent several hours trying to figure out the issue before I stumbled on this. I ended up changing my JAVA_HOME to the JDK embedded with Android Studio which happens to be 1.8.0_152. Solved the issue.

To locate embedded JDK location, in android studio navigate to File > Other Settings > Default Project Structure

0
votes

It looks like your computer is not configured properly. You can install everything required with NativeScript Sidekick, on the first launch it tries to configure everything needed for you. To manually install the missing JDK you can go to Java SE Downloads.

Good luck!

0
votes

Possible Causes and resolutions.

1.Missing JAVA_HOME.Configure JAVA_HOME as system variable
2.Missing JAVA in PATH.Configure JAVA in PATH system variable.
3.Missing Android_HOME.Configure ANDROID_HOME as system variable.

Default ANDROID_HOME LOCATION

C:\Users\%USER%\AppData\Local\Android\Sdk

This should resolve the problems detected by tns doctor

-1
votes

Actually it was JAVA_HOME path issue.