my dog learned polymorphism*
The moose likes Java in General and the fly likes Check if 32 bit or 64 bit processor? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Check if 32 bit or 64 bit processor?" Watch "Check if 32 bit or 64 bit processor?" New topic
Author

Check if 32 bit or 64 bit processor?

Aparna Sree
Greenhorn

Joined: Jul 21, 2010
Posts: 28
Is there a way to find out if the processor is 32 bit or 64 bit?

System.getProperty("os.arch") or System.getProperty("sun.arch.data.model") checks for the OS.

Similarly do we have anything specific to processor in Java?



Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

Does it matter? You can't use any 64-bit features of the processor if the OS is only 32-bit.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Aparna Sree
Greenhorn

Joined: Jul 21, 2010
Posts: 28
Ok!
I wasn't sure of the behavior of a 64 bit processor with 32 bit OS .
I have DLLs for 64 bit machine and 32 bit machine which I am supposed to execute through java. I had to check the processor version before executing.
That info helped. Thanks!
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

64-bit DLLs will not work on 32-bit Windows, even if the processor is 64-bit. So if you just use the OS architecture that will be just fine.
 
Don't get me started about those stupid light bulbs.
 
subject: Check if 32 bit or 64 bit processor?
 
Similar Threads
running eclipse on Ubuntu
Apache HTTP 2.0.6.3 Server - Does it support 64bit windows.
How to check the jdk bit version (32bit or 64 bit)
How to install sdk1.4 32bit on itanuim 64ia
32bit vs 64bit confusion