ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Morten S. Mortensen" <>
Subject RE: Ant 1.6.0 Long Filename support
Date Mon, 12 Jan 2004 08:44:02 GMT

Hi, I have some opinions:

The correct way to set up paths like JAVA_HOME, ANT_HOME, ... is:

JAVA_HOME=C:\Program Files\Sun\j2sdk1.4.2_03
ANT_HOME=C:\Program Files\Apache Group\apache-ant-1.6.0

- that is, *without* quotes.
Because: At some points of usages, quotes are needed (the commandline!) and at others not.
The quotes become a part of the value. If quotes are put on the value, it becomes impossible
to use the value without those.

Setting the Windows PATH like -
set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin
- also works for paths *with* spaces.

When Suns installation-program for the JDK suggests an installation-path like "C:\j2sdkxxx",
they are way off, because the suggested path for installing a program on a Windows machine
is <main drive like C:\><progam dir>/<name of firm/organisation>/<product
name>/... They just want "visibility". Sun also have some problems following standards,
which are not their own. Putting everyting at the same level "C:\" clutters up the file-system
namespace. I can understand that some want to put their Java-installation or Ant-installation
at the root - for reasons of "easy access" of some kind.

However, suggesting something like "spaces should never be used in paths" is WAY OFF - plain
wrong! -Specify paths without quotes and *if* a path is used as part of a commandline, put
quotes around the path, because the function interpreting the commandline looks for quotes
and therefore quotes are necessary to have the path become a single argument, not multiple

There are many fault programs out there, which do not handle spaces correctly - but it is
not the Sun JDK, Ant - or any other of a handfull of other Apache software, which I just happens
to use.

The file-separator is '\'. The command-line separator is ' '. Do not mix the two. -Which is
usually done by putting quotes at the point of usage, not the point of declaration.

Morten Sabroe Mortensen

-----Original Message-----
From: Jacob Kjome []
Sent: 12. januar 2004 00:09
To: Ant Users List
Subject: RE: Ant 1.6.0 Long Filename support

At 04:18 PM 1/11/2004 +0000, you wrote:
> > You are going to have to quote all paths that contain spaces such as...
> >
> > ANT_HOME = "C:\Program Files\Apache Group\apache-ant-1.6.0"
> > JAVA_HOME = "C:\Program Files\Java\jdk1.3.1_09"
>That's puts me straight back to square one.  Removing the quotes from around
>just ANT_HOME gave me another error:
>'Files\Java\jdk1.3.1_09"" was unexpected at this time.'
>All my paths in PATH are quoted too.

I guess I gave you bad information as Conor has stated.  Sorry about 
that.  Either way, you can avoid this by using my suggestion below...

> > Why don't you save yourself a million headaches and just install anything
> > Java-related to a path with no spaces such as...
> >
> > ANT_HOME = C:\apache-ant-1.6.0
> > JAVA_HOME = C:\jdk1.3.1_09
> >
> > Everything will work in this case.  Even if things *should* work in the
> > other case, they *do* in this case, so save yourself the trouble
> > and always use paths without spaces.
><small rant>But I hate an untidy directory structure.  It bugs the hell out
>of me that I have to have multiple programs in root at work.  ESRI, Oracle
>and Tomcat all have trouble with directories with spaces.  Long filenames
>have been around for 8 years.  Programs should be able to work with them by
>now. </small rant>

Like I said, maybe it *should* work, but the fact that it works only 
sporadically when you use paths with spaces and it works perfectly when you 
use paths without spaces should give you pause at ever using spaces for 
paths to Java programs.  And  you needn't use the exact paths I 
suggested.  You could have...

ANT_HOME = C:\Java\Apache\apache-ant-1.6.0
JAVA_HOME = C:\Java\Sun\jdk1.3.1_09

What's so hard about that?  There's nothing magical about "Program 
Files".  Use any naming convention you want, just make sure to remember to 
avoid paths with spaces for Java programs.  It might be lame, but you might 
think about picking your battles and not spending any more energy on an 
issue outside of your control.


>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message