Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JAVA_HOME is incorrectly set when launching Zookeeper on Windows

I'm having a "JAVA_HOME is incorrectly set" error when launching Zookeeper on windows with zkServer.cmd while it is correctly set! When I issue %JAVA_HOME% I got C:\Program Files\Java\jdk1.7.0_45 which is the correct directory of the java instalation.

I suspect the problem is due to the space in program files, as when I issue %JAVA_HOME%\bin\java.exe (the command used in zkEnv.cmd) I got:

'C:\Program' is not recognized as an internal or external command, operable program or batch file.

How I can fix this?

like image 650
bachr Avatar asked Aug 20 '14 17:08

bachr


2 Answers

Quote the path.

"%JAVA_HOME%\bin\java.exe"

like image 157
Fueled By Coffee Avatar answered Sep 28 '22 16:09

Fueled By Coffee


in my environment i setted to:

JAVA_HOME=C:\Progra~1\Java\jdk1.8.0_65


Note for Windows users on 64-bit systems

Progra~1 = 'Program Files'

Progra~2 = 'Program Files(x86)'

like image 21
jaoul85 Avatar answered Sep 28 '22 16:09

jaoul85