Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working with bat files, and I need to use Java 1.7. Unfortunately the output of:

@echo off
java -version

is that I'm using Java 1.6.0_27b. I completely removed Java, and the directories do not exist anymore in Program Files (x86) nor Program Files. Why is it that the jvm still exists, and why is it pulling version 1.6? How can I go about removing it?

share|improve this question

Most likely you also have a java.exe file in your %systemroot% folder, i.e. c:\windows.

share|improve this answer

Install the UnxUtils package from (Or Cygwin if you're feeling ambitious.) That will give you the which command, which you can use to determine exactly where that java is running from. Make sure you do which java.exe and not just which java.

C:\>which java.exe
C:\Program Files\Java\jdk1.7.0_51\bin\java.exe

That will let you figure out where it's installed, and from there you can probably infer which distribution it is and how to uninstall it. The output of java -version should tell you who produced it, too, along with that version number. (Though the version "1.6.0_27b" pretty much means it's Sun/Oracle's.) Once you find the installation, you may be able to run an uninstaller from there, or you may be stuck manually removing the files and PATH entries.

share|improve this answer


echo %path%

Make sure you don't have another folder of java somewhere other than the ones that you mentioned. Look out for java and jdk.

share|improve this answer

You have to remove the location to the earlier java from your windows environment path variable. To do so,

a. Right-click MyComputer

b. goto Properties

c. Click on "Advanced System Settings" on the left hand upper side of the window.

d. Click on Environment Variables

e. Check in the User Variables if there is a JAVA_HOME variable and remove the same

f. In the System Variable , double-click on PATH and and remove the line that is specifying the the path to java1.6.

g. Add the path to the new java i.e. 1.7 to the path.

h. Check the same using fresh command line.

share|improve this answer
His question is " Why is it that the jvm still exists, and why is it pulling version 1.6? How can I go about removing it?" Your answer does not cover any of this. – DavidPostill Sep 22 '14 at 9:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.