Finding OSX version inside java

I need to check if osx version <10.5 inside java is this possible?

+1
source share
4 answers

Try

System.getProperty("os.name")

and / or

System.getProperty("os.version")

It returns a string

HERE , you can find more information about System.getProperties

+4
source

Use System.getProperty .

System.getProperty("os.version");

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

+3
source

, System getProperties . . "Os.version"

+1

System.getProperty("os.version")

OS X, : 10.5.1

System.getProperty("os.name"), , OS X

+1

All Articles