Java, Linux, MacOs

Get your OS distribution details in Java

I wrote a little utility class to get the OS details in Java.

As you may know, you can get the name, version and architecure of your OS in java by using System properties.

But this information is limited.

For instance, on Mac Os, you will get the version but can not know what is the name of your platform (Lion, Mavericks?)

It’s even worse for Linux, you don’t have any indication of the distribution (Fedora, RedHat, Ubuntu, etc.)


So if you need to get more details about your OS, feel free to use that utility class, you’ll find it here:


And if you have access to different OS platforms, you can help me by testing the utility class on your OS.

see all details in the Readme file of the project on github, section ‘Wanna help?’


2 thoughts on “Get your OS distribution details in Java”

  1. Idunno … especially on Linux, given its extreme flexibility in customization and setup, getting the OS details may not provide any value. Why not do sort of feature detection, instead of OS details detection?

    I think there’s a similar idea behind feature detection instead of browser sniffing in web apps.

  2. Even on other OSes, you could customize many things (starting by which JDK you are using) 🙂
    This class is doing nothing more than reporting the OS version, and I wrote it because it was useful for one of my use cases, but feel free to code some extra information collector class and do a pull request on the github project and I’ll include it!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s