Hi Raja,
Paul left out a $ sign. Here are my commands for setting the environmental variables:
Setting JAVA_HOME can be useful for other tools/applications (e.g.
ant,
j2ee...). Then just refer to that variable in your PATH statement. As you can see, you need to prefix any environmental variable with a $ sign if you want to use the contents of it.
As Paul suggested, you could put this in your ~/.bashrc file. Another place could be in ~/.bash_profile.
I put the commands above in /etc/profile.d/java.sh - that way these variables are set up for everyone who logs onto my machine (you do need to be certain that this is desirable though - will everyone logging on want to have these variables configured?).
Again, I have moved this topic to the Linux forum. It does not really belong in the
SCJD forum.
Regards, Andrew