1

I'm trying to make my first app using Phonegap and I got this while running in command

C:\USERS\KTR\DESKTOP\PHONEGAP\LIB\ANDROID\BIN>create C:\Users\KTR\Desktop\Demoap
p com.example.Demoapp Demoapp
The JAVA_HOME environment variable is not set.
Set JAVA_HOME to an existing JRE directory.
Remember to also add JAVA_HOME to the PATH variable.
After updating system variables, open a new command window and retry.

Any help would be greatly appreciated Thank you

xaizek
  • 5,098
  • 1
  • 34
  • 60
aingineer
  • 73
  • 1
  • 1
  • 2
  • Related section contains all kinds of, well, related and similar questions, with [top one](http://stackoverflow.com/questions/2619584/how-to-set-java-home-on-windows-7) providing a list of solutions basically for all JAVA_HOME related problems. If you can't read these questions and answers, how do you expect to benefit from answers to your "unique" question? – Oleg Estekhin Jul 03 '14 at 09:32
  • sorry i read did read the other answers on the other posts. I didnt realize that java and jdk were completely different because i had just the java path sorry – aingineer Jul 03 '14 at 10:21

2 Answers2

7

You have to do two things to get it fixed.

Firstly go to My Computer right click open properties and open Advanced System Setting and then open Environment variables. Open the Path variable and insert a semicolon at the end and add the path of your bin folder of your jdk it will be something like C:/Program Files/Java/ Jdk X.Y/bin save and close it.

Secondly create a new system variable named JAVA_HOME and in its value write C:/Program Files/ Java/ Jdk X.Y save and close and now retry by writing the create command

P.S find the version number go to your java folder and copy those version number hopefully this will help

mushahid
  • 504
  • 5
  • 21
1

You need Java on your computer. See how to install and configure java http://docs.oracle.com/cd/E19509-01/820-3208/inst_cli_jdk_javahome_t/

Hope this will help

Pracede
  • 4,226
  • 16
  • 65
  • 110