开发者

Finding the version of OSX inside java

开发者 https://www.devze.com 2022-12-12 06:55 出处:网络
I need to test if the version of osx is < 10.5 inside ja开发者_开发百科va is this possible?Try

I need to test if the version of osx is < 10.5 inside ja开发者_开发百科va is this possible?


Try

System.getProperty("os.name")

and/or

System.getProperty("os.version")

It returns String

HERE you can find more info about System.getProperties


Use System.getProperty.

System.getProperty("os.version");

The list of valid arguments for the function can be found here


I think the System getProperties method can get that information for you. See "os.version"


System.getProperty("os.version")

Should return a string with three values for OS X, like: 10.5.1

You can also do System.getProperty("os.name") to make sure it's OS X in the first place

0

精彩评论

暂无评论...
验证码 换一张
取 消