Newbie on debian and trying to make Java 7 the default java version used

debian, linux

Solution

sudo update-alternatives --config java

Is the command to swap it i believe.

You can then call

which java

and it should reference the version selected.

Problem

2 questions. - After installing the Oracle Java 7 on my new Debian local box, I opened up a terminal and executed the following command: java -version When I did that it states: java version "1.6.0_26" Java(TM) SE Runtime Environment (build 1.6.0_26-b03) Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing) I installed the Java 7 JDK and Java 7 JRE in the following directories respectively: /usr/lib/jvm/jdk1.7.0 /usr/lib/jvm/jre1.7.0 - Is there a way to remove the java-6-sun and java-6-sun-1.6.0.26 folders as well or will it hurt just to leave them there? Any help/direction on these 2 questions would be appreciated. Regards.

Original source