1 31 32 package org.antlr.xjlib.foundation; 33 34 public class XJSystem { 35 36 public static boolean isMacOS() { 37 return System.getProperty("os.name").toLowerCase().startsWith("mac os"); 38 } 39 40 public static boolean isWindows() { 41 return System.getProperty("os.name").toLowerCase().startsWith("windows"); 42 } 43 44 public static boolean isLinux() { 45 return System.getProperty("os.name").toLowerCase().startsWith("linux"); 46 } 47 48 public static String getOSVersion() { 49 return System.getProperty("os.version"); 50 } 51 52 public static String getOSName() { 53 return System.getProperty("os.name"); 54 } 55 56 public static String getOSArchitecture() { 57 return System.getProperty("os.arch"); 58 } 59 60 public static String getJavaRuntimeVersion() { 61 return System.getProperty("java.runtime.version"); 62 } 63 64 public static String getLineSeparator() { 65 return System.getProperty("line.separator"); 66 } 67 68 public static String getTempDir() { 69 return System.getProperty("java.io.tmpdir"); 70 } 71 72 public static void setSystemProperties() { 73 if(isMacOS()) 74 System.setProperty("apple.laf.useScreenMenuBar","true"); 75 } 76 } 77 | Popular Tags |