METHOD -1
Open a notepad
Enter this
set path=(drivein which java is stored):\program files\java\jdk(version)\bin;
set classpath=(drivein which java is stored):\program files\java\jdk(version)\lib;
save as "path.bat" in the folder where u have strored the javafile
- Open cammand editor
- Enter "path" click ENTER
now you can execute your program
METHOD-2
- Open cammand editor
- And write the following one by one
- set path=(drivein which java is stored):\program files\java\jdk(version)\bin;
- set classpath=(drivein which java is stored):\program files\java\jdk(version)\lib;
METHOD-3
Right click on my computer icon and go for properties
-->properties
Then go into Advanced tab
-->advanced
Now, click on Environment variablies
-->environment variables
now you have user variables and system variables
below user variables u have 3 options
new edit delete
Click on new of user variable
A box with varaiable name and variable value gets opened
Enter variable name as 'class path'
variable value as
- (drivein which java is stored):\program files\java\jdk(version)\lib;
egs: C:\program files\Java\jdk1.6.0\lib;
Enter variable name as 'path'
variable value as
- (drive in which java is stored):\program files\java\jdk(version)\bin;
egs: C:\program files\Java\jdk1.6.0\bin;
METHOD-3 SETS PATH PERMANENTLY.
METHOD-1,METHOD-2 SHOULD BE DONE EVERY TIME U OPEN A COMMAND EDITOR
Now you can execute your programs on command prompt