title: How can I detect a Unix-like OS in Java?
body: <p>Ok, I know that <code>System.getProperty("os.name")</code> will give me the name of the OS I'm running under, but that's not a lot of help. What I need to know is if the OS I'm running on is a 'Unix-like' OS, I don't care if it's HP-UX, AIX, Mac OS X or whatever.</p>
  
  <p>From the <a href="http://lopica.sourceforge.net/os.html" rel="noreferrer">list of possible os.name values</a> it seems like a quick and dirty way of detecting a 'Unix-like' OS is checking if <code>os.name</code> does <strong>not</strong> contain "Windows". The false positives that will give me are OSes my code is very unlikely to encounter! Still, I'd love to know a better way if there is one.</p>