get OS Name - Java Native OS

Java examples for Native OS:OS

Description

get OS Name

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        System.out.println(getOSName());
    }/*from  w w w .  j  a  v a2  s. c om*/

    private static String getOSName() {
        return System.getProperty("os.name").toLowerCase();
    }
}

Related Tutorials