tags:

views:

253

answers:

2

Is there a way to find what architecture an ant script is running on? Currently I have the following:

<echo>System = ${os.name} ${os.arch}</echo>

which produces:

[echo] System = Linux i386

This not correct, as I am running 64 bit linux.

Thank you

+2  A: 

Since Ant is running inside a JVM, it will only detect the architecture of the JVM. Run Ant with a 64-bit JVM and you'll get a different value of ${os.arch}.

If you want to detect the architecture of the underlying OS, you need to look at environment variables or check the output from something like uname.

JesperE
A: 

maybe Java's system property ${os.arch}. More information here.

dfa