Sometimes you get a silly and annoying error like:
> Files\Java\jdk1.8.0_111"" was unexpected at this time.
This is a clue that the space in "Program Files" has thrown something off.
If you have set JAVA_HOME, for example, as
then elsewhere we use it as %JAVA_HOME%, other programs will fail because they will see that space and think that
which is of course wrong, and they will also be completely baffled about what to do withJAVA_HOME=c:\Program
The extra double quote(s) in the message indicate that one piece of software (or perhaps you yourself) attempted to camouflage that space by doing something like:Files\Java\jdk1.8.0_111
which works for *some* programs, but not all.JAVA_HOME="C:\Program Files\Java\jdk1.8.0_111"
A better and more reliable way to avoid that space is to use the alternate 8.3 name for C:\Program Files, often called the "tilde name" because it usually contains the "~" name in it.
To find the alternate 8.3 name for C:\Program Files, open up CMD.EXE and do:
You should see something like:cd \ dir /x pro*
PROGRA~1 is the alternate 8.3 name for Program Files, and PROGRA~2 is the alternate 8.3 name for Program Files (x86). Now go find the place where you did:Directory of C:\ 10/23/2016 10:07 AM <DIR> PROGRA~1 Program Files 12/16/2016 05:47 PM <DIR> PROGRA~2 Program Files (x86)
and change it toJAVA_HOME="C:\Program Files\Java\jdk1.8.0_111"
You no longer need the quotes because there is no space in the alternate name.JAVA_HOME=C:\PROGRA~1
After making a bunch of environment variable changes like this, it's usually a good time to re-start the computer, pour a new cup of coffee, and move on to see what the next problem might be.