Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cannot lanuch ant when JDK installed in a directory with space

 
Boyan Wu
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34384
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Boyan,
Do you have quotes around the directory name?
 
Boyan Wu
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's like an ancdote:
- Doctor, it hurts when i do like this...
- So don't do it!
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The 8 character DOS name works for me. Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic