Link to home
Start Free TrialLog in
Avatar of Anthony Lucia
Anthony Lucia

asked on

JAVA_HOME fails on spaces and quotation marks with SET command

On WIndows 2008...

From a Command prompt...

I performed the following:

SET JAVA_HOME="c:\program files (x86)\Java60\jre"

Open in new window


Now I can do the following:

echo %JAVA_HOME%
"c:\program files (x86)\Java60\jre"

Open in new window



So now I try an installation procedure of Shibboleth, and later in the install, the install crashed on this line:

  set JAVACMD="%JAVA_HOME%\bin\java.exe"

Open in new window



The command prompt now breaks out of the .bat file and reports the following:

\Java60\jre"\bin\java.exe" was unexpected at this time.
  set JAVACMD=""c:\program files (x86)\Java60\jre"\bin\java.exe"

Open in new window


There are two spaces in the JAVA_HOME "Program Files (", so I have to set the JAAVA_HOME with quotation marks, as follows:

SET JAVA_HOME="c:\program files (x86)\Java60\jre"

Open in new window


... and either the spaces or the quotation marks are causing an issue

How can I fix this?

Thanks
Avatar of dpearson
dpearson

Much the simplest fix (if you can) is to reinstall Java so it has no space in the path.  Personally I always put it in:

"C:/Java/..."

If not you will keep running into these sorts of problems.

Doug
ASKER CERTIFIED SOLUTION
Avatar of Mazdajai
Mazdajai
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You dont have to set JAVA_HOME if you install official java package