Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 set the environment variable to setup JAVA_HOME.

Problem is, java is installed in c:\program files\blah\blah\

(notice the whitespace in the folder path).

so this works:

"%JAVA_HOME%\bin\java" -version

but w/o the quotes it doesn't.

I need to move the java folder to a directory like: c:\java\

Would moving it break anything?

I just un-installed and re-installed, and the darn thing didn't even ask me where I want to install it!

share|improve this question
up vote 5 down vote accepted

There's a registry key below HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment which is looked up by %windir%\system32\java.exe and others, like probably your browser. Just have a look with regedit - the keys and values should be obvious, or have a look at Deploying the JRE on Windows for JDK 1.6.

share|improve this answer

There are registry entries to worry about. But if you care only about the installation, and not about the browser plugin, then you can move it without caring about them.

In the latest versions of the JDK, there are copies of the java and javac executables inside the Windows\system32 directory - you might need to remove them and explicitly modify your global Windows path variable to have the JDK\bin directory.

share|improve this answer

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.