# Is it possible to check for operating system?

**URL:** <https://discourse.processing.org/t/is-it-possible-to-check-for-operating-system/14180>\
**Category:** Processing for Android\
**Created:** [September 24, 2019, 7:52pm UTC](https://discourse.processing.org/t/is-it-possible-to-check-for-operating-system/14180 "2019-09-24T19:52:57Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [September 25, 2019, 3:59pm UTC](https://discourse.processing.org/t/is-it-possible-to-check-for-operating-system/14180/3 "2019-09-25T15:59:23Z")

</div>

Here is an example of how to use that to run platform-specific setup and configuration – and store a convenient global variable with the value you are looking for:

```auto
String osType;

void setup() {
  osType = osSetup();
  println(osType);
}

String osSetup () {
  String os = System.getProperty("os.name");
  if (os.contains("Windows")) {
    // os-specific setup and config here
    return "win";
  } else if (os.contains("Mac")) {
    // ...
    return "mac";
  } else if (os.contains("Linux")) {
    // ...
    return "linux";
  } else {
    // ...
    return "other";
  }
}

```

Note that your case detection can be anything – win32/64, or checking for a particular linux version that you know doesn’t work, or making it only “mac” vs “other”. A previous example:

- [Physically based rendering library for Processing SimplePBR](https://discourse.processing.org/t/physically-based-rendering-library-for-processing-simplepbr/8152/6)

---

_[View the full topic](https://discourse.processing.org/t/is-it-possible-to-check-for-operating-system/14180)._
