I want to determine the bit architecture of my OS i.e whether it is a 32-bit OS or a 64-bit OS using Java code.
I have tried the following:
System.out.printlnSystem.getProperty("os.name")); //gives OS name -> Windows/Linux/Solaris
System.out.println(System.getProperty("os.arch")); //gives JVM architecture -> amd64
System.out.println(System.getProperty("sun.arch.data.model")); //gives JVM architecture again but just the bit -> 64
However none of the above give me the OS architecture. They give the respective output which is mentioned in comments besides the code lines.
How can I determine the OS architecture ?