I am doing Java programming on Debian. By default Debian 6.x ships with libgcj JVM. On starting eclipse it shows a warning that this JVM is deprecated and may cause problems. For this reason I downloaded the JVM from Oracle's site and installed it. However after installing the Oracle JVM the default JVM on system is still libgcj.When I type java -version I get following output - java version 1.5.0gij (GNU libgcj) version 4.4.5How should I remove this from my system? And after that how should I set the newly installed JVM to be the default one. This would involve two things - Setting the bin directory on system path.Making javaw the default program when a jar is double clicked.I'm familiar with these tasks on Windows but not on Linux. Thanks.
How to to remove libgcj from Debian?
debian;software installation;java
Debian has a command that enables possibilities to choose a program from a list of programs that do something similar. The command update-alternatives sets links to default programs for various operations. To choose a default java command from a list of installed JVMs one need to run  as root command: update-alternatives --config java and choose the java edition to use. If java is not registered (installed) in alternatives subsystem you need to install it by using update-alternatives --install /usr/bin/java java /path/to/jdk 1 . From update-alternatives manual description of --install option:--install link name path priority [--slave link name path]...Add  a  group  of  alternatives to the system.  link is the generic name for the master link, name is the name of its symlink in the alternatives directory, and  path  is  the alternative  being introduced for the master link.  The arguments after --slave are the                generic name, symlink name in the alternatives directory and the alternative path for a                slave  link.   Zero  or  more --slave options, each followed by three arguments, may be                specified. Note that the master alternative must exist or the call will  fail.  However                if  a  slave  alternative  doesn't exist, the corresponding slave alternative link will                simply not be installed (a warning will still be  displayed).  If  some  real  file  is                installed  where  an alternative link has to be installed, it is kept unless --force is                used.edit summary:  Answer edited to contain comments suggestions below by Manula Waidyanatha and Gilles - many thanks.