I am using RHEL 5.4 linux and writing my first few java test programs.
javac and java comes by default, so I have been able to run a Hello World program.
I want to check what is the current classpath.
Nothing comes in
$ echo $CLASSPATH
or
$ env | grep -i classpath
Does it mean that the classpath variable is optional and we only set it when we want to set a project specific values?
Also, how is it able to find the standard java jars? because I am able to use System.out.println ? Does it mean that classpath is used to specify non-standard java jars, because java already knows where it has installed the standard jars, so it doesn’t need CLASSPATH for its internal use..
when you do
it will look for system env variables, if its not set it will be blank and by default current DIR would be the classpath.
It will first look into Bootstrap classes then Extension Classes and then User Custom classes
Also See