Why do we add a semicolon in java PATH variable and not for the JAVA_HOME variable? -


i have basic question ask, why need add semicolon @ end of path variable , why don't add semicolon in java_home variable?

i read lot of books , forums,

  1. to separate different paths in path variable? or tell system or jre not further after that.

  2. java_home variable jre more files , extensions jdbc drivers etc. in future development.

path operating system-specific idea. means, "when type command, check these paths well". current directory in on searched paths default. if think minute, can imagine how of pain use command line if didn't have idea of path.

so, given path (with multiple directories), need way separate entries. each operating system can use whatever character, 2 popular semi-colon (on windows) , colon (on systems unix, e.g. mac os x).

java_home points wherever preferred java installation located. 1 value, no need character separate entries.

as aside, you'll run classpath, paths of of libraries (jars) , resources (e.g. property files) java app loading. classpath uses same format/characters path.

as exercise, try writing little bit of code loops on , prints out values of system.getproperties() , system.getenv(). it's great way see of little configuration elements.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -