Java&Jsp&Servlet2015. 2. 23. 19:03

import java.util.regex.Pattern;

public class ServerInfo {

public static void main(String[] args) {
    String osName = System.getProperty("os.name");
    boolean osBoolean = Pattern.matches("Windows.*",osName);
    System.out.println(osName);
    System.out.println(osBoolean);

 
}

OS 가 Windows 이면 true 끝

 

Posted by 비니미니파파