private static boolean isUnderRosetta() {
    try {
      if (JnaLoader.isLoaded()) {
        IntByReference p = new IntByReference();
        SystemB.size_t.ByReference size = new SystemB.size_t.ByReference(SystemB.INT_SIZE);
        if (SystemB.INSTANCE.sysctlbyname("sysctl.proc_translated", p.getPointer(), size, null, SystemB.size_t.ZERO) != -1) {
          return p.getValue() == 1;
        }
      }
    }
    catch (Throwable t) {
      Logger.getInstance(CpuArch.class).error(t);
    }

    return false;
  }
private static boolean isUnderRosetta()