> For the complete documentation index, see [llms.txt](https://ref.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ref.gitbook.io/notes/java/untitled.md).

# Untitled

`compile group: 'org.slf4j', name: 'slf4j-api', version: '2.0.0-alpha1'` -> `slf4j-api-2.0.0-alpha1.jar`

testCompile group: 'org.slf4j', name: 'slf4j-simple', version: '2.0.0-alpha1'

This <https://crunchify.com/how-to-add-resources-folder-properties-at-runtime-into-intellijs-classpath-adding-property-files-to-classpath/> help me added a resources folder in intellij project

{% embed url="<https://www.pixelstech.net/article/1549365534-The-difference-between-System-load-and-System-loadLibrary-in-Java#comment_zone>" %}

Get OS type:

```java
  private static final int osType;
  
  String osName = System.getProperty("os.name");
  if (osName.startsWith("Linux")) {
      if ("dalvik".equals(System.getProperty("java.vm.name").toLowerCase())) {
          osType = ANDROID;
          // Native libraries on android must be bundled with the APK
          System.setProperty("jna.nounpack", "true");
      }
      else {
          osType = LINUX;
      }
  }
  else if (osName.startsWith("AIX")) {
      osType = AIX;
  }
  else if (osName.startsWith("Mac") || osName.startsWith("Darwin")) {
      osType = MAC;
  }
  else if (osName.startsWith("Windows CE")) {
      osType = WINDOWSCE;
  }
  else if (osName.startsWith("Windows")) {
      osType = WINDOWS;
  }
  else if (osName.startsWith("Solaris") || osName.startsWith("SunOS")) {
      osType = SOLARIS;
  }
  else if (osName.startsWith("FreeBSD")) {
      osType = FREEBSD;
  }
  else if (osName.startsWith("OpenBSD")) {
      osType = OPENBSD;
  }
  else if (osName.equalsIgnoreCase("gnu")) {
      osType = GNU;
  }
  else if (osName.equalsIgnoreCase("gnu/kfreebsd")) {
      osType = KFREEBSD;
  }
  else if (osName.equalsIgnoreCase("netbsd")) {
      osType = NETBSD;
  }
  else {
      osType = UNSPECIFIED;
  }
  boolean hasBuffers = false;
  try {
      Class.forName("java.nio.Buffer");
      hasBuffers = true;
  }
  catch(ClassNotFoundException e) {
  }
  // NOTE: we used to do Class.forName("java.awt.Component"), but that
  // has the unintended side effect of actually loading AWT native libs,
  // which can be problematic
  HAS_AWT = osType != WINDOWSCE && osType != ANDROID && osType != AIX;
  HAS_JAWT = HAS_AWT && osType != MAC;
  HAS_BUFFERS = hasBuffers;
  RO_FIELDS = osType != WINDOWSCE;
  C_LIBRARY_NAME = osType == WINDOWS ? "msvcrt" : osType == WINDOWSCE ? "coredll" : "c";
  MATH_LIBRARY_NAME = osType == WINDOWS ? "msvcrt" : osType == WINDOWSCE ? "coredll" : "m";
  HAS_DLL_CALLBACKS = osType == WINDOWS;
  ARCH = getCanonicalArchitecture(System.getProperty("os.arch"), osType);
  RESOURCE_PREFIX = getNativeLibraryResourcePrefix();
}
```

\`

```java
String osName = System.getProperty("os.name");
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ref.gitbook.io/notes/java/untitled.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
