arnold
arnold

Reputation: 1712

JDK is updated but previous version is still getting shown as current version

Previously in my machine, for

javac -version 

I was getting

javac 1.6.0_65

I needed JDK 8 so I downloaded it from here and installed it. But still I am getting the same version. But when I am running

`/usr/libexec/java_home -v 1.8 --exec javac -version` 

I am getting

`javac 1.8.0_11`.

What I am doing wrong?

Upvotes: 3

Views: 120

Answers (1)

Pablo Santa Cruz
Pablo Santa Cruz

Reputation: 181270

When you install Java 8 your previous Java versions (Java 6, Java 7) don't get uninstalled.

You need to:

  1. Explicitly uninstall Java 6
  2. Or, change your JAVA_HOME location. If you are using linux you could try: /usr/sbin/alternatives --config java (at least in RH based distributions).

Upvotes: 1

Related Questions