Melinda
Melinda

Reputation: 1531

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

2 questions.

  1. 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

  1. 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.

Upvotes: 12

Views: 12038

Answers (2)

Bastien Durel
Bastien Durel

Reputation: 613

sudo update-java-alternatives -s ... will configure all the alternatives at the same time update-java-alternatives -l lists the alternatives

Upvotes: 3

Mike McMahon
Mike McMahon

Reputation: 8614

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.

Upvotes: 22

Related Questions