Detecting System Architecture in Ant

Is there a way to find which architecture the ant script is running on? I currently have the following:

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

which produces:

[echo] System = Linux i386

This is not true as I am running 64-bit Linux.

thanks

+3
source share
3 answers

Since Ant runs inside the JVM, it only detects the JVM architecture. Run Ant with the 64-bit JVM and you will get another value of $ {os.arch}.

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

+5
source

possibly the Java system property $ {os.arch}. More info here .

0
source

:

<property environment="env"/>
<condition property="systemWindows" value="64" else="86">
   <available file="${env.windir}/SysWOW64"/>
</condition>
0

Source: https://habr.com/ru/post/1717020/


All Articles