Does Java has any API to call that can know whether a process or an .exe file is 32-bit or 64-bits? - not the JVM in which your code is running
There is no standard Java API for determining whether an external process is 32 or 64 bit.
If you wanted to do this, you would either need to use native code, or call an external utility to do this. The solution is likely to be platform specific in both cases. Here are some possible (platform specific) leads:
(OSX) Is there a way to check if process is 64 bit or 32 bit?
(Linux) https://unix.stackexchange.com/questions/12862/how-to-tell-if-a-running-program-is-64-bit-in-linux
(Windows) http://blogs.technet.com/b/windowshpc/archive/2009/03/27/how-to-tell-if-a-exe-file-is-a-32-bit-or-64-bit-application-using-dumpbin.aspx
(Note that in the Windows cases, the solution involves testing the ".exe" file rather than the running process, so you need to be able to determine the relevant ".exe" file first ...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With