Finding the version of OSX inside java

前端 未结 4 1319
情深已故
情深已故 2021-01-24 01:56

I need to test if the version of osx is < 10.5 inside java is this possible?

相关标签:
4条回答
  • 2021-01-24 02:08

    Try

    System.getProperty("os.name")
    

    and/or

    System.getProperty("os.version")
    

    It returns String

    HERE you can find more info about System.getProperties

    0 讨论(0)
  • 2021-01-24 02:12

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

    0 讨论(0)
  • 2021-01-24 02:30

    Use System.getProperty.

    System.getProperty("os.version");
    

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

    0 讨论(0)
  • 2021-01-24 02:30

    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 讨论(0)
提交回复
热议问题