Take the 2-minute tour ×  How can I tell if the JVM my
application runs in is 32 bit or 64-bit? Specifically, what
function or preference do I access to detect this within the
program?  share|improve this question Just out of curiosity, why
would you need to know the natural size of the system? Details
such as this are abstracted away in Java, so you shouldn't (in
theory, at least) have to know them. –  Patrick Niedzielski Jan
14 '10 at 4:29 It lets me roughly estimate the memory
requirements for objects due to pointers. Curiosity too --
seemed like there should be a way, but I'd never heard of it. – 
BobMcGee Jan 14 '10 at 18:33 This "detail" is not abstracted
away when interacting with the Java Native Interface. 32-bit
DLLs can't be loaded with a 64-bit JVM (and vice versa). So this
is quite essential information for anyone using JNI. It's a pity
that there seems to be no portable way to obtain this info. One
way is to first try loading a 32-bit version of the DLL, and if
it fails, try the 64-bit version, e