How to set path in Java

How do I set or change the PATH system variable?


When you compile and execute a java program then this type of error can come on your command prompt.so now we will fix this problem. 

'javac' is not recognized as an internal or external command,operable program or batch file.

1.open control panel

  • click on system and security


  • Next click on system


  • Next Click on Advanced system settings



  • Next Click on Environment variables 



  • Next  under system variables search for path
  • if path variable don't exist then click on new and follow the step-3 at last.



  • Next after finding the path variable  click on edit and delete everything from  variable values



2. Go to My computer and open c drive

  • Next click on program files 



  • Next search for java file  and  then  open java file



  • Next open jdk  folder

  • Next open bin  folder



  • Next click on upper rectangular box and copy address 



  • Next paste the address in  variable values  box


-------------------Done-------------------

3.if path variable don't exist then  

first click on new then enter

Variable name: Path
Variable value: paste the address of the java file from c-drive .
Follow the  Step - 2 for Address




after paste address , click on OK ....OK......OK

------------------DONE----------------






Now compile your program and execute 



Comments