How to determine Mac OS X version with code?

Possible duplicate:
Search for OSX version inside java

I want to check the current version of Mac OS X running a Java application using Java code. In particular, I want to know whether it is Leo or not.

That way, I can determine whether to use the library or not.

+5
source share
3 answers

Using:

System.getProperty("os.name") // Yields "Mac OS X"
System.getProperty("os.version") // Yields "10.7.4" for me on Lion
+15
source
+4
source

You have tried the following:

System.getProperty("os.name");

You can find more detailed information on the page " System Properties" .

0
source

All Articles