wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes cannot lanuch ant when JDK installed in a directory with space Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "cannot lanuch ant when JDK installed in a directory with space" Watch "cannot lanuch ant when JDK installed in a directory with space" New topic
Author

cannot lanuch ant when JDK installed in a directory with space

Boyan Wu
Greenhorn

Joined: Dec 30, 2003
Posts: 9
Hi, all, I am trying ant 1.6.2. I have created a very simple built file from user manual. In my xp machine, I have installed jdk in default location, that is, it is under C:\Programm Files\..., I have defined JAVA_HOME in Path varailbe. However, I got an error when running ant,it shows

Files\java\jdk_1.5.0_01bin"" was unexpected at this time.

It seems the space in JAVA_HOME is not correctly handled. I have moved the same thing to a win2k machine where jdk is installed directly under c:. Everything is ok. Is there any work arounds for the xp machine?
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31057
    
232

Boyan,
Do you have quotes around the directory name?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Boyan Wu
Greenhorn

Joined: Dec 30, 2003
Posts: 9
1. I have set the JAVA_HOME in the path environment varaible, I tried both with double quotes and without quotes, but either works

2. I also tried to set JAVA_HOME in my batch script with quotes and clear the path varaible first and then assign JAVA_HOME to path as the first value, but also does not work

I searched bugzilla in apache's website, there is similar bug report before but is should be fixed in earlier versions.
Eugene Lucash
Ranch Hand

Joined: Feb 19, 2005
Posts: 77
It's like an ancdote:
- Doctor, it hurts when i do like this...
- So don't do it!
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
Did you try switching to 8 char DOS names (e.g., "Program Files" -> "Progra~1")

I prefer to install jdk elsewhere but this could save you some pain.
Boyan Wu
Greenhorn

Joined: Dec 30, 2003
Posts: 9
The 8 character DOS name works for me. Thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cannot lanuch ant when JDK installed in a directory with space