Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

2 Answers 2

up vote 4 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

 
discard

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.