Why we have to set path in java?

We need to set the path for executable file to access anywhere within the operating system drivers and folder .We can set the path in two ways:
  1. At the command promt temporarily and
  2. At the system environment variable permanently

At Command promt :

set path=%path%;E:\J2SDK1.4.2.04\bin

At System Environment Variables :

  • Right click on My Computer and select property.
  • Click on advance
  • Click on environment variable button
  • Click on new button under variable write path if not already define and value write  E:\J2SDK1.4.2.04\bin 
  • Click on all OK button one by one 
  • if path variable is already there the please update only value as  ;E:\J2SDK1.4.2.04\bin in last