# java - How to specify jdk path in eclipse.ini on windows 8 when path contains space

This doesn't work

-vm %JAVA_HOME%/bin/javaw.exe

How can I replace %JAVA_HOME% with full path on windows 8 when path contains space ("program files" directory)

Have you tried it. Don't put everything in single line.

``````-vm
C:\Program Files\Java\jdk1.6.0_07\bin\javaw.exe
``````

If it doesn't work then please confirm you have added above lines before `-vmargs` in `eclipse.ini`.

Add the entry of vm above the vm args else it will not work..! i.e `

```    -vm
C:\Program Files\Java\jdk1.7.0_75\bin\javaw.exe
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx512m
```

Solution in:How do I set the eclipse.ini -vm option?

-vm C:\\bin\javaw.exe

`````` -vm
C:\<java_path>\bin\javaw.exe
``````

Must be in the first thing in eclipse.ini

Try to escape the space with back slash.. Like

C:\program\folder\ \name\java\jdk\bin

Windows-vm "C:\Program Files\Java\jdk1.6.0_07\jre\bin\javaw.exe"

I have Windows 8.1 and my JDK under "Program Files" as well. What worked for me was replacing the name of the folder by the 8-digit internal MS-DOS name.

``````-vm
C:/PROGRA~1/Java/jdk1.8.0_40/bin/javaw.exe
``````

I realized what was going on after running this in cmd.exe

``````CD \
DIR P* /X
``````

It returned...

``````<DIR>          PROGRA~1     Program Files
<DIR>          PROGRA~2     Program Files (x86)
``````

So we can find out how to use a path containing spaces

All above answers didn't work for me. My Eclipse mars is x64 but I need to set registry dll to x86 for another software.

At the end I put -vm argument at the end of shortcut and this did the trick.

`D:\mars\eclipse\eclipse.exe -vm "C:\Program Files\Java\jre7\bin\server\jvm.dll"`

According to this doc jvm.dll also work for some cases.

-vm C:\Program Files\Java\jdk1.6.0_07\bin\javaw.exe

Reinstall java and choose a destination folder without a space