The problem that the JDK set in JAVA_HOME does not appear even if java -version is performed at the command prompt

Prerequisites

PC environment

JAVA_HOME JDK does not appear even if java -version is done at the command prompt

As the title says, the solution is as follows.

Execute the following command

C:\Users\test>set JAVA_HOME
C:\Users\test>where java

If the following is displayed, a file with a name such as Java 6 Update 45 is installed, so uninstall it.

C:\Users\test>set JAVA_HOME
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_21

C:\Users\test>where java
C:\Windows\System32\java.exe
C:\Program Files\Java\jdk1.7.0_21\bin\java.exe

When you restart your PC and execute the following command, C: \ Windows \ System32 \ java.exe should be deleted.

C:\Users\test>where java
C:\Program Files\Java\jdk1.7.0_21\bin\java.exe

Now when you run java -version, the JDK set in JAVA_HOME will be loaded correctly.

C:\Users\test>java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

Supplement

Unless it is a major update such as language version upgrade after building the environment once You don't need to have the updater installed, as you probably won't update the JDK.

-Official Java 6 update finished -April 2013 Alert Regarding Critical Patch Update (Regular) of Oracle Java SE (JPCERT / CC)

Recommended Posts

The problem that the JDK set in JAVA_HOME does not appear even if java -version is performed at the command prompt
Java passes at the command prompt, but javac does not
[Firebase] The problem that the currentUser of Firebase Auth does not become null even if the app is uninstalled.
Setting method that the size does not change even if CSS is changed
A story that suffered from a space that does not disappear even if trimmed with Java The cause is BOM
If the JDK version is correct in Eclipse but an error occurs or the compiler does not work properly
Compile Java at the command prompt
An active hash that can be treated as data even if it is not in the database
Processing when an ID that does not exist in the database is entered in the URL
[Java] Dealing with the situation where the program that writes to the Output Stream of Process does not end even if waitFor
A story that solved the problem that the Java (jdk) version was too high to use the h2o library in R and R Studio.
The story that .java is also built in Unity 2018
When a Java file created with the Atom editor is garbled when executed at the command prompt
Even if I write the setting of STRICT_QUOTE_ESCAPING in CATALINA_OPTS in tomcat8.5, it is not reflected.
Directory is not created even if directory task is described in Rakefile
[Rails] The problem that pry-byebug does not stop through breakpoints
[Rails] Solving the problem that session timeout does not work
[Java] com.sun.glass.WindowEvent is imported and the window does not close