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.
Using:
System.getProperty("os.name") // Yields "Mac OS X" System.getProperty("os.version") // Yields "10.7.4" for me on Lion
You can look at the system property os.version http://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html
os.version
You have tried the following:
System.getProperty("os.name");
You can find more detailed information on the page " System Properties" .