tags:

views:

82

answers:

4

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

+4  A: 

Try

System.getProperty("os.name")

and/or

System.getProperty("os.version")

It returns String

HERE you can find more info about System.getProperties

Maksim
+3  A: 

Use System.getProperty.

System.getProperty("os.version");

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

Yacoby
As always, when down-voting please say why. I am also here to learn, so if there is something wrong with my answer I would love to know.
Yacoby
+1  A: 

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

jedierikb
+1  A: 

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

Dan