Como definir java_home no Windows 7?

Eu fui para as Variáveis de ambiente em 'Sistema' no painel de controle e criei duas novas variáveis, uma para variáveis de usuário e outra para variáveis de sistema. Ambos foram nomeados JAVA_HOME e ambos apontando para

C: \ Sun \ SDK \ jdk \ bin

Mas, por algum motivo, ainda recebo o erro abaixo ao executar um comando Java ...

BUILD FAILED
C:\Users\Derek\Desktop\eclipse\eclipse\glassfish\setup.xml:161: The following error  occurred while executing this line:
C:\Users\Derek\Desktop\eclipse\eclipse\glassfish\setup.xml:141: The following error occurred while executing this line:
C:\Users\Derek\Desktop\eclipse\eclipse\glassfish\setup.xml:137: Please set java.home to a JDK installation

Total time: 1 second
C:\Users\Derek\Desktop\eclipse\eclipse\glassfish>lib\ant\bin\ant -f setup.xml
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar
Buildfile: setup.xml

Como posso resolver este problema?

questionAnswers(18)

yourAnswerToTheQuestion