aingineer
aingineer

Reputation: 73

The JAVA_HOME environment variable is not set

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

Upvotes: 1

Views: 61694

Answers (2)

mushahid
mushahid

Reputation: 514

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

Upvotes: 8

Pracede
Pracede

Reputation: 4361

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

Upvotes: 1

Related Questions