使用方法:
OSinfo.isWindows()
OSinfo.isLinux()
添加相应jar包到Java项目即可, jar包:(保留作者信息)
jar下载位置:
-
/**
-
* @author: 吴永行
-
* @dateTime: 2014-8-20 下午3:55:43
-
* @description:
-
*
-
*/
-
-
public enum EPlatform {
-
Any("any"),
-
Linux("Linux"),
-
Mac_OS("Mac OS"),
-
Mac_OS_X("Mac OS X"),
-
Windows("Windows"),
-
OS2("OS/2"),
-
Solaris("Solaris"),
-
SunOS("SunOS"),
-
MPEiX("MPE/iX"),
-
HP_UX("HP-UX"),
-
AIX("AIX"),
-
OS390("OS/390"),
-
FreeBSD("FreeBSD"),
-
Irix("Irix"),
-
Digital_Unix("Digital Unix"),
-
NetWare_411("NetWare"),
-
OSF1("OSF1"),
-
OpenVMS("OpenVMS"),
-
Others("Others");
-
-
private EPlatform(String desc){
-
this.description = desc;
-
}
-
-
public String toString(){
-
return description;
-
}
-
-
private String description;
-
}
阅读(2994) | 评论(0) | 转发(0) |