0
I need to know why we need to set the environment path?
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
0
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
0
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
0
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
0
https://contextlogic.zendesk.com/hc/en-us/sections/200647939-Refunds