In java environment we can write java code which will make us enabled to get the operating system type.
Java example program to get Operating System type or architecture
java get OS type
In java environment we can write java code which will make us enabled to get the operating system type. We can get the operating system architecture or system type by using the system property.
Here this java example code displays how one can get the current running operating system's type. The property "os.arch" gives operating system version that you are running. We can get this property's value by using the method getProperty() of the java.lang.System .
Here is the full code of GetOSArchitecture.java is as follows:
GetOSArchitecture.java
import java.util.*;
|
Output:
C:\javaexamples>javac GetOSArchitecture.java C:\javaexamples>java GetOSArchitecture Operating system type =>x86 |