OS detector : OS « Development Class « Java






OS detector

       

import java.util.logging.Logger;

public final class OSUtils {
  public static final boolean isLinux() {
    return System.getProperty("os.name").equals("Linux");
  }

  public static final boolean isMacOSX() {
    return System.getProperty("os.name").equals("Mac OS X");
  }

  public static final boolean isWindows() {
    return System.getProperty("os.name").startsWith("Windows");
  }

  public static final boolean isSolaris() {
    return System.getProperty("os.name").equals("SunOS");
  }

}

   
    
    
    
    
    
    
  








Related examples in the same category

1.Class representing a standard operating system platform, WIN, MAC, or POSIX.
2.Get OS
3.Platform specific functionality.
4.Condition that tests the OS type.
5.Class to help determining the OS
6.Splits apart a OS separator delimited set of paths in a string into multiple Strings.
7.Get the operating systemGet the operating system
8.Get the OS
9.Virtual Machine Information (JVM)
10.Java Platform Information
11.Get OS Info
12.Platform Detector
13.OS name
14.Operating System