aniugne
aniugne

Reputation: 67

JDK 8 not available in classpath

I have Java 7 in my machine from a long time .And now I have installed Java 8 too .The problem is even after changing the JAVA_HOME & path variable to point to jdk 8, I still get jdk 7 in the classpath.

Snapshot of the environment variables below

But I get the below when checking the version in windows.Is there anything else I should do to get it pointed to jdk8?

C:\Users>java -version
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

Snapshot of the environment variables below

enter image description here

Upvotes: 1

Views: 396

Answers (4)

Sasikumar Murugesan
Sasikumar Murugesan

Reputation: 4520

  1. Remove java.exe, Javac.exe and javaw.exe from system32
  2. Remove oraclePath like some text in path of system variable(from jdk8 it will create a new system variable when installing)

Upvotes: 1

Paul Ngom
Paul Ngom

Reputation: 319

Go in control panel and type java in the search box type java. Click on the link on the java label. Then click on tab java. You will see the active runtimes. Untick the one you don't need.

Upvotes: 0

HELOX
HELOX

Reputation: 529

Four things that come to mind:

  1. You seem to have edited the user variables. Have you looked at the system variables? I would prefer to set the JAVA_HOME and PATH variables at system level.
  2. Have you restarted cmd/Windows?
  3. You could type where java in your cmd to see where Windows finds Java(s).
  4. What is your PATH variable? Looking at your snapshot I it to contain at least %JAVA_HOME%\bin.

Upvotes: 0

Yuthara
Yuthara

Reputation: 1

Can you check in your System variables that in the PATH variable, there is no path to your JDK 7?

Even if you define or override a Path variable in the "user" variables, Windows just concatenate the system variables with the user ones, in this order.

So if there is a path to your JDK 7 in System path, you will have this kind of value : PATH=;.....;D:\java\jdk8;%MAVEN_HOME%

Upvotes: 0

Related Questions