I need to know why we need to set the environment path?

26th Sep 2015, 1:34 AM
Anup Jaguri
7 Answers
+ 1
when you set the path on your environmental var this path will serve as a shojrtcut to, javac.exe and other java tools using the command prompt you can easily type in javac <file.java> to compile so this serves as a shortcut instead of typing the whole path over and over again cd path/jdkversion/bin/> path/jdkversion/bin/> javac file.java you can use simply javac command to compile and java command to run
24th Jun 2016, 2:24 PM
Drako Gemini
Drako Gemini - avatar
hi it's nice question. m also newbie but liil research told me that we need to define environment because in case path is not set and u compile using javac it will get an error saying path not set. there is no problem with java compiler or syntax problem is command line.. u need to give path of jdk in cmd line before javac it will tell cmd line where to search for javac environment. now everytime u will be required to give path of ur jdk quite rigorous and irritating isn't it. so we set path so that comand line works accordingly. keep working all the best
3rd Oct 2015, 7:54 PM
Kanish Roshan
Kanish Roshan - avatar
hey I'm also new but I think we need to set the path so that the command print can know where the 'java.exe' file is stores so that it can use it to compile the code u wrote
24th Jun 2016, 3:36 PM
Tejas Bhatt
Tejas Bhatt - avatar
jre means java runtime environment, in java u write once run any where so because of platform independent it does not know path, u needs to set environment path
24th Jun 2016, 6:50 PM
Tomal - avatar
28th Jun 2016, 5:38 AM
Ira Maarit Laamanen
Ira Maarit Laamanen - avatar