For brute-force uninstalls, you just "rm -rf /usr/java/jdkXXXXX", assuming you had it installed in the generally-accepted place for Linux using untar/unzip. However, don't do this for RPM installs, since that will leave disconnected references in the RPM database, which is untidy.
Since (thank goodness) there's nothing like the Windows Registry to complicate things in Linux (that **** in gnome doesn't apply here), there's nothing else to worry about.
If people have been running java applications, local accounts may have created hidden java directories with app preferences in them. You can delete them or leave them as you like.
You can inventory RPM's via "rpm -qa | grep -i java" for the names of any remaining Java packages. If you don't find any, just delete the JRE directory. Like the JDK, there's no magic.
Although I'm talking Sun's Java here. I forgot about that nasty gcj stuff that come in later Fedora and RHEL releases. It's tied into the Preferences system, which is a nasty little mess as far as I'm concerned, even if it does offer java choices on a per-user basis (So does JAVA_HOME in most apps with a lot less fuss, though).
If you're trying to rip out the gcj stuff, I can only recommend you google out a list of the packages. And be prepared to discover that OpenOffice or Evolution or something requires one or more of them so you can't rip them out after all.
Originally posted by Sunil Kumar:
I tried and it works, but the next issue is it doesn't removes jre at the same time.Still java -version gives me the "java version "1.3.1" installed on my system
So, can you suggest how to remove/uninstall the jre as well, i tried "rpm -e jre-1.3.1-fcs"
Just delete the symbolic link in /usr/java which is pointing back to the alternate stuff and set $JAVA_HOME when you install a fresh copy to point to its location. That symbolic link is messing you up. To determine its location, issue a "which java" command, this will point to the link and then follow the link to /etc/alternate. This symbolic link is a whole lot more trouble that worth it. Just get rid of it.