1
2
3
4
5
6
7
8
9
10 package ch.qos.logback.core.testUtil;
11
12 public class Env {
13
14 static public boolean isWindows() {
15 return System.getProperty("os.name").indexOf("Windows") != -1;
16 }
17
18 static public boolean isLinux() {
19 return System.getProperty("os.name").indexOf("Linux") != -1;
20 }
21
22 static public boolean isJDK6OrHigher() {
23 String javaVersion = System.getProperty("java.version");
24 if (javaVersion == null) {
25 return false;
26 }
27 if (javaVersion.startsWith("1.6") || javaVersion.startsWith("1.7")) {
28 return true;
29 } else {
30 return false;
31 }
32 }
33
34 }