ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Clark <robert.cl...@quest.com>
Subject Re: How can ant detect it is running on a 64 bit machine?
Date Fri, 14 Oct 2005 17:23:51 GMT
On Thursday October 13, 2005 08:06 pm, "Marion, Patrick" 
<patrick.marion@certive.com> wrote:
> Problem:
> 	have ant tell me whether I am running on a 64 bit architecture.
>
> I thought the solution was:
>
> 	check for the value of the "os.arch" property.
>
> Unfortunately, if I can make something out of the value returned on
> Windows ("amd64) I can't on Linux (it returns "i386" which is
> identical to the one on a 32 bit machine); solaris sparc just
> returns "sparc".  The only os.* properties which seem to be
> available to ant at start time seem to be: "version", "name", and
> "arch".

If you are running a Sun (or IBM, I believe) 1.4+ VM. You can check 
the system property "sun.arch.data.model". This will be "32" for a 32 
bit VM and "64" for a 64 bit VM.

For earlier versions of the above JVMs, you could reasonably assume 
that they are 32-bit. 

However, that still means that you have to figure what to do for other 
VMs and platforms.

- Rob

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message