Failed to run "javac -version"

2,157 views
Skip to first unread message

Aldir Koch

unread,
Feb 26, 2015, 8:50:11 AM2/26/15
to phon...@googlegroups.com
hi, im trying to add platform android but the cordova is returning the follow error:

Creating android project...

C:\Users\aldir.koch\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\node_modules\q\q.js:126
                    throw e;
                          ^
Error: Failed to run "javac -version", make sure you have a Java JDK (not just a JRE) installed.
    at C:\Users\aldir.koch\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\lib\check_reqs.js:43:27
    at ChildProcess.exithandler (child_process.js:662:7)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:766:16)
    at Process.ChildProcess._handle.onexit (child_process.js:833:5)
ReferenceError: t is not defined
    at flush (C:\Users\aldir.koch\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:126:21)
    at process._tickCallback (node.js:442:13)

When i run the javac -version, i get the result:

javac 1.5.0_11
javac: no source files
Usage: javac <options> <source files>

I using windows 8.1

Thanks for the help.

mharr

unread,
Feb 26, 2015, 10:25:31 AM2/26/15
to phon...@googlegroups.com
I'm not exactly sure of the error, but I do notice that you seem to have old version of JDK installed.  Current ADK requires JDK 7, and you seem to have JDK 5 installed.

Also make sure you have all the environment variables set.  From PhoneGap Getting Started Guide:
  • you need to include the SDK's tools and platform-tools directories in your PATH.
  • You may also need to enable Java and Ant. Open a command prompt and type java, and also type ant. Append to the PATHwhichever of these fails to run: %JAVA_HOME%\bin;%ANT_HOME%\bin.
Reply all
Reply to author
Forward
0 new messages