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.

do
ls -l /usr/bin/java
and
ls -l /usr/bin/javac

and look at the output.

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)

Sun's documentation states "The default class path is the current directory".

installing NETBEANS IDE.... Guess i need not to set anything else..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.