Possible Duplicate:
How do I detect which kind of JRE is installed — 32bit vs. 64bit
How can I tell if I'm running in 64-bit JVM or 32-bit JVM?
I have a signed Java applet that utilizes installed third party DLL's for use of a card scanner component in my Java application. On 64 bit machines there are a few libraries that are intended to be used for 64 bit architectures as the original versions of these libraries only run on x86.
The problem is that they are named differently...
library.dll
and on x64 I should be using...
library64.dll
I have to call loadLibrary
to load the appropriate library by name in my applet, however to load the right one I need to predetermine the system architecture. I know that I could just catch an UnsatisfiedLinkError but that is really ugly and I want to avoid that if possible. I also can't presume where the library was installed to.
Any ideas how to figure this out from a Java application?