Joe Starnes
Joe Starnes

Reputation: 491

Error when building Ionic APP using Cordova

(node:16112) UnhandledPromiseRejectionWarning: CordovaError: Failed to run "javac -version", make sure that you have a JDK installed. You can get it from: http://www.oracle.com/technetwork/java/javase/downloads. Your JAVA_HOME is invalid: C:\Program Files (x86)\Java\jre1.8.0_171

I checked my user environment variable and I have the variable JAVA_HOME and set to "C:\Program Files (x86)\Java\jre1.8.0_171"

I also have C:\Program Files (x86)\Java\jre1.8.0_171 appended to the user environment variable PATH.

Upvotes: 1

Views: 464

Answers (1)

rmlan
rmlan

Reputation: 4657

make sure you have a JDK installed

This is the relevant part of this error message. Your JAVA_HOME points to a Java Runtime Environment (JRE), not to a Java Development Kit (JDK).

javac is the Java compilation command, which Cordova is attempting to execute in this case. However, javac is not shipped with the JRE as it is a development tool.

You need to download and install a JDK and set JAVA_HOME to point to it

Upvotes: 3

Related Questions