• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Change directory using ant task

 
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

How do i change directory using ant .I am using and it gives Execute failed: java.io.IOException: java.io.IOException: cd: not found.

Can you pls advice?
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The concept of a current directory doesn't exist within Ant. You would be better off making your directory references relative to a defined property.

The immediate reason that your task failed is because "cd" wasn't locatable as an external command. Often 'cd' is built into the command shell and doesn't exist as a discrete external program.

For programs that do exist discretely, it's better to specify their full pathname. Not only does that help Ant find them, it protects you from alternative programs that have the same name - such programs may exist for several reasons, some good, some evil.

However, returning specifically to 'cd'. If 'cd' was an external command, it's not unlikely that Ant would have issued the 'cd', changed the directory for duration of that task, then reverted to its original setting. Which is one more reason why you don't want to use the 'cd' command in Ant.
reply
    Bookmark Topic Watch Topic
  • New Topic