I thought that setting up the PATH variable was a must if we wanted to use java or javac commands on linux (preferably in the bashrc file), but I am able to use these commands anywhere without setting up the PATH variable.. Similarly, without specifying '.' in the CLASSPATH variable (in fact, not specifying the CLASSPATH variable at all), I am able to access class files in the same directory. How is it possible ?

I checked the /usr/bin directory and I did find 'java' and 'javac' present there. But the PATH should have have been to SDK's bin.

Thanks a lot. I typed update-alernatives --list java and it showed me the link to sun's bin.

But the CLASSPATH variable, its not set but java seems to find the class files in the same directory (even though it should happen only if '.' is set in the CLASSPATH)

This question has already been answered. Start a new discussion instead.