ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jose M Urena <>
Subject Re: [E] Javac: Command-Line Argument Files
Date Fri, 03 Aug 2018 13:01:57 GMT
the following suggestion I have learned for working with Jenkins jobs which
can have very long paths for the workspace

1. if you have permission on your computer/server to create windows shares
and to run from shared drive,
then you could save most of the characters to the left of your path by
using PUSHD

if your current dir is c:\users\yourname\documents\ which is  28 characters
then pushd will reduce it to 3, saving you 25 characters

::  call your ant script


:: leave the temp drive, remove it from windows shares
net share /delete TEMPSHORTPATH
:: confirm share was cleaned
net use
net share

2. if the issue is with commands under your c:\program files,  like
c:\program files\oracle\jdk180\bin\javac
you can try using MKLINK to remove spaces and shorten the path
 mkdir c:\dev
 cd c:\dev
 mklink /j jdk "c:\program files\oracle\jdk180"

now you can use c:\dev\jdk\bin\javac which is shorter than  c:\program

3. if you can not use PUSHD, mklink can be used to shorten paths but it is
not as short as pushd
mkdir c:\dev
cd c:\dev
mklink /j doc "c:\users\yourname\documents\"

On Fri, Aug 3, 2018 at 6:25 AM Pietro Paolini <> wrote:

> Hi all,
> I am a bit struggling with an build.xml file <javac> task, I haven't got
> too much experience with Ant but hopefully my question won't sound too
> silly. On a window machine I reach the
> Command line limit size and the compiler task fails as "the extension or
> file name is too long".
> I am wondering if  it could be possible to get advantage of
> Is there a quick win on that ? I couldn't find much on Google :-(
> Thanks,
> Pietro
> Pietro Paolini
> Consultant
> Alfa
> ________________________________
> e: | w:<
> >
> t: +44 (0) 20 7920-2643 | Moor Place, 1 Fore Street Avenue, London, EC2Y
> 9DT, GB
> ________________________________
> The contents of this communication are not intended to be binding or
> constitute any form of offer or acceptance or give rise to any legal
> obligations on behalf of the sender or Alfa. The views or opinions
> expressed represent those of the author and not necessarily those of Alfa.
> This email and any attachments are strictly confidential and are intended
> solely for use by the individual or entity to whom it is addressed. If you
> are not the addressee (or responsible for delivery of the message to the
> addressee) you may not copy, forward, disclose or use any part of the
> message or its attachments. At present the integrity of email across the
> internet cannot be guaranteed and messages sent via this medium are
> potentially at risk. All liability is excluded to the extent permitted by
> law for any claims arising as a result of the use of this medium to
> transmit information by or to Alfa or its affiliates.
> Alfa Financial Software Ltd
> Reg. in England No: 0248 2325
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message