You can query system property os.arch to determine your operating system architecture and derive how whether you are on 32bit or 64bit OS
If you are concerned with your JVM ( you can run 32bit JVM on 64bit system) use
sun.arch.data.model
property
Use this task as an example how to access these values
task printProps << {
println System.properties['os.arch']
println System.properties['sun.arch.data.model']
}
More information could be found at the below links:
How can I tell if I'm running in 64-bit JVM or 32-bit JVM (from within a program)?
How to find the OS bit type