File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 19759
    
  20

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: 19759
    
  20

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Check if 32 bit or 64 bit processor?