If i develop an application in Java, How can i know whether it is 64 bit or for 32 bit OS ?
Thanks in advance,
If you really want to know, you can look at the "os.arch" system property:
On the system which I'm using right now, which has 32-bit Windows Vista, it says "x86". I guess that for a 64-bit Windows system it would say "x86-64" or something similar.
sun.arch.data.model=32 // 32 bit JVM
sun.arch.data.model=64 // 64 bit JVM
You can use
to determine if its 32/64 from the program.
From the sun.docs:
When writing Java code, how do I distinguish between 32 and 64-bit operation?
There's no public API that allows you to distinguish between 32 and 64-bit operation. Think of 64-bit as just another platform in the write once, run anywhere tradition. However, if you'd like to write code which is platform specific (shame on you), the system property sun.arch.data.model has the value "32", "64", or "unknown".