code: static String getLibraryType(String os) {
          if (os.startsWith("Linux")) {
              return "so";
          }
          if (os.startsWith("FreeBSD")) {
              return "so";
          }
          if (os.startsWith("Mac OS X")) {
              return "dylib";
          }
          if (os.startsWith("Windows")) {
              return "dll";
          }
          throw new IllegalArgumentException();
      }
docs: i only tested linux, the others are here just in case. i got them from http://lopica.sourceforge.net/os.html