当前位置: 技术问答>java相关
(求教)我想取得OS的系统信息,看了HELP文档,可是还是没搞明白~~~
来源: 互联网 发布时间:2015-10-21
本文导语: System properties. The following properties are guaranteed to be defined: java.version Java version number java.vendor Java vendor specific string java.vendor.url Java vendor URL java.home Java installation directory java.class.version Java class ver...
System properties. The following properties are guaranteed to be defined: java.version
Java version number
java.vendor Java vendor specific string
java.vendor.url Java vendor URL
java.home Java installation directory
java.class.version Java class version number
java.class.path Java classpath
os.name Operating System Name
os.arch Operating System Architecture
os.version Operating System Version
file.separator File separator ("/" on Unix)
path.separator Path separator (":" on Unix) line.separator Line separator ("n" on Unix)
user.name User account name
user.home User home directory
user.dir User's current working directory
我现在只是想获得其中的OS。NAME 和OS。VERSION,
怎么从其中获得
谢谢
Java version number
java.vendor Java vendor specific string
java.vendor.url Java vendor URL
java.home Java installation directory
java.class.version Java class version number
java.class.path Java classpath
os.name Operating System Name
os.arch Operating System Architecture
os.version Operating System Version
file.separator File separator ("/" on Unix)
path.separator Path separator (":" on Unix) line.separator Line separator ("n" on Unix)
user.name User account name
user.home User home directory
user.dir User's current working directory
我现在只是想获得其中的OS。NAME 和OS。VERSION,
怎么从其中获得
谢谢
|
System.getProperty("os.name");
System.getProperty("os.version");
System.getProperty("os.version");