user4069483
user4069483

Reputation:

Perhaps JAVA_HOME does not point to the JDK

i am getting this error during making phonegap build

C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:601: The followin
g error occurred while executing this line:
C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:720: The followin
g error occurred while executing this line:
C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:734: Unable to fi
nd a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files\Java\jre1.8.0_25"

Total time: 45 seconds



D:\xampp\htdocs\mymind\mymind\mymind\platforms\android\cordova\node_modules\q\q.
js:126
                    throw e;
                          ^
Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,D:\xampp\htdocs\mymi
nd\mymind\mymind\platforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.
dir=ant-gen

i think problem with the PATH which i have added to the system variables of the windows envirement variables.

another error

BUILD FAILED
C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:653: The followin
g error occurred while executing this line:
C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:698: null returne
d: 1

Total time: 14 seconds


D:\xampp\htdocs\mymind\mymind\mymind\platforms\android\cordova\node_modules\q\q.
js:126
                    throw e;
                          ^
Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,D:\xampp\htdocs\mymi
nd\mymind\mymind\platforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.
dir=ant-gen

Error: D:\xampp\htdocs\mymind\mymind\mymind\platforms\android\cordova\build.bat:
 Command failed with exit code 8
    at ChildProcess.whenDone (C:\Users\umar.farooq\AppData\Roaming\npm\node_modu
les\phonegap\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspaw
n.js:135:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

Upvotes: 0

Views: 14931

Answers (2)

Chepaki
Chepaki

Reputation: 56

Make sure you're using the Java SE SDK and not the Java EE SDK, because android wouldn't recognize the second.

Upvotes: 1

Predrag Maric
Predrag Maric

Reputation: 24403

It is currently set to "C:\Program Files\Java\jre1.8.0_25"

jre stands for Java Runtime Environment, and you need jdk which is Java Development Kit.

So, JAVA_HOME should point to C:\Program Files\Java\jdk1.8.0_25, and in your PATH system variable you should have C:\Program Files\Java\jdk1.8.0_25\bin.

Upvotes: 3

Related Questions