Finding the version of OSX inside java

天涯浪子 提交于 2019-12-02 04:13:28

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!