Java-Get OS and User Property

Get OS and User Property

The System.getProperty( ) method is used to you can obtain the values of various environment variables. The following properties use to find Operating System and User property : Operating system name
os.version Operating system version
os.arch Operating system architecture
user.dir User working directory
user.home User home directory User account name


0 (1) - Copy - Copy (1)

Program Source

public class Javaapp {

    public static void main(String[] args) {
        System.out.println("Os Name    : "+System.getProperty(""));
        System.out.println("Os Version : "+System.getProperty("os.version"));
        System.out.println("Os Architecture : "+System.getProperty("os.arch"));
        System.out.println("User Directory : "+System.getProperty("user.dir"));
        System.out.println("User Home  : "+System.getProperty("user.home"));
        System.out.println("User Name  : "+System.getProperty(""));

Leave a Comment