Error: Failed To Run "javac -version", Make Sure That You Have A JDK Installed
Solution 1:
Search for "edit environment variables" in start. and under user variables add a new variable with name "JAVA_HOME" and value with path_to_jdk_bin.
like this
Now under system variables, the path variable should contain(add if not added) the entry %JAVA_HOME%.
Like this
Solution 2:
Firstly make sure you don't have multiple java versions installed
Once you're done with that open Environment Variables tab under My computers
Create a new user variable and name it PATH
Set the user variable value as C:\Program Files\Java\jdk1.8.0_151\bin(may change depending on where you have installed java)
open cmd type javac
This should be enough to make it work
Solution 3:
I've been trying to figure this out and just found a solution I haven't seen elsewhere.
I noticed I had a second version of Java installed in my Program Files (x86)
directory.
Pointing the variables to that location instead, ie C:\Program Files (x86)\Java\jdk1.8.0_131
and now everything works fine.
Solution 4:
Try This:
In VS, open Tools menu and select Options.
In Tools for Apache Cordova select Environment Variable Overrides .
Select JAVA_HOME checkbox and browse for JDK directory.
Post a Comment for "Error: Failed To Run "javac -version", Make Sure That You Have A JDK Installed"