Specifying Ant file paths in Linux / Unix

I am trying to write an Ant script in Linux. I'm having some difficulties expressing paths.
I want to write the paths relative to my home directory... unix style. So like this:
]]>

But when I run the script in IntelliJ I get an error message:
"Could not find path intellij/projects/untitled5/~/projects/squadleader/deployment"

but if I go to a shell and type
"cd ~/projects/squadleader/deployment"
I change to the correct directory as expected.

I have ended up specifying full paths in my ant script e.g.
/home/amross/projects/squadleader/deployment

but I would prefer to use the relative paths.
Anyone know how I should be doing this??

Unix is not my strong point! :)

2 comments

~ is not a real directory, it's just an expansion that most command shells (bash, etc.) convert to the value of your home directory when you type it.

In Java, there's a system property "user.home" (see http://java.sun.com/docs/books/tutorial/essential/system/properties.html for more system properties) that should contain the equivalent of ~.

0

On Mon, 08 Dec 2003 06:56:01 +0000, David Bream wrote:

But when I run the script in IntelliJ I get an error message: "Could not
find path intellij/projects/untitled5/~/projects/squadleader/deployment"


~/ is the SHELL expansion macro, its not expanded by the OS itself. You
could pull out the HOME environment var thou.

0

Please sign in to leave a comment.