시스템1 Java 시스템 운영체제 정보 출력하기 Java 애플리케이션이 현재 동작하고 있는 시스템 운영체제 정보 출력하기 위해서는 System.getProperty("os.name") 코드를 사용하면 된다. 프로퍼티에서 가져온 정보를 기반으로 조건문을 사용해서 OS를 구분한다. public class SystemOsMain { public static void main(String[] args) { String os = System.getProperty("os.name").toLowerCase(); if (os.contains("win")) { System.out.println("Windows"); } else if (os.contains("mac")) { System.out.println("Mac"); } else if (os.contains("ni.. 2019. 6. 4. 이전 1 다음