Your Site
  • Home
  • Tour
  • API
  • Blog
  • About
false

Java Environment Variables Settings

Environment Variables:

CLASSPATH - Points to the jar files(tools.jar,rt.jar etc) needed for the execution of  the java application.
PATH -Points to the Java installation folder where java executable files (java,javac etc.) are found.
 Significance of Environment Variables in Java :

Java can be run without setting the environment variables too.



With setting the PATH variable ,Java can be able to run at any location on your drive i.e., java is available globally in your system.
    If you enter any command in the  command prompt :
    • First, OS(kernel) checks for the executable by the name of command  in the current directory.
    • If not available it goes to the locations in the PATH variable if the executable is found  in those locations , then that will be executed.  
    •  Else  displays the message not recognised as internal or external command 
    CLASSPATH holds the class files needed for the execution of the  application.
    • If any java class is not found,JVM checks for the class in the locations specified in this variable.
    •  If found success else java compiler raises an error like  cannot find symbol.
    • This variable can hold directory locations,zip files,jar files separated by semicolon(;).
    Posted by Wenky at 2:24 AM
    Labels: CLASSPATH, Environment Variables, PATH
    PAgeType:item|
    FOOTER