You are on page 1of 2

why what how of environment variable and why its needed suppose you have written programme P in language

L. Now you want to run it in a computer which has windows os. Now if you run P directly on windows , windows does not understand its syntax an d wont be able to run P. So to run P we need another program called compiler C.Each language has a compil er or anything like that which is used to run any progrm written in that languag e.This compiler program understands this language l and how to run programs writ ten in this language. So to run this programme L on any OS you need to have C also present on that os along with P. Thus to run any program P written in any language L on any OS O You need to have 3 programs on the same computer P Your program C Compiler program which will run P as this only understands its syntax O This will act only as a medium where C will run p. The function of os is to just call and meet both c and p and then rest all is handles by C and os also p rovides medium to c to represent output of program p and take input to program p . this medium may be command prompt console(for output) , keyboard(for input) So to c can run p when both are placed at same place for example you need to place your java code and jdk setup file at the same plac e then pushd that location and run your command the java command actually calls C. similary perl command calls c of perl languag e similary python command calls c of python. Now to avaoid this nesscity to put your C and P at the same place you can put C at a permanent location and then tell windows that location and when you will w ant to run this p again using c via cmd prompt then windows will call c from tha t permanent location. Since cmd promt is location of windows where p is run using c the function of wi ndows os is just to meet both so to do this windows should know address of other one if they are not in same place. so ideally we place c permanently at one location and then tell windows this add ress and then whenever in windows anywhere JAVA/PERL/PYTHON command is written w indows will automatically call c. So there is a variable PATH which stores all these addresses of C and some other adresses of which is required by windows for its use. all these addresses are separated by ;. so just add address of your c in the already existing values of system variabl ' PATH'. thats it so windows will search your c in all adresses given in values of PATH variable. how to add vaue to path var see this vid http://showmedo.com/videotutorials/video?name=960000&fromSeriesID=96 see this also

http://docs.python.org/2/faq/windows#id9

You might also like