🗒️
notes
  • Journal
  • URLs
  • Java Card
    • SCP02
    • Rapid Notes
    • _FIXVALS_
    • Mifare
    • Chain Of Trust
  • Encoding
    • CBEFF
    • Bytes
  • Snippets
    • JNI_OnLoad
  • float to byte[]
  • Protobuf
  • C/C++
    • Containers
    • Basics
    • JNI
    • gcov
    • Castings
  • chess
    • Untitled
  • Compression
    • Untitled
  • Snippets
    • Untitled
  • Build Systems
    • Maven
    • Windows
  • Gradle
  • CMake
  • Java
    • Untitled
    • Certificates
  • Android
    • Mifare
  • Python
    • ctypes
  • WebSub
    • References
  • Spring Boot
    • Form-based Authentication
    • Basic Access Authentication
    • JWT Authentication
  • QR Code
    • Denso QR Code
  • Philosophical Inquiry
    • First
  • XML
    • xmlstarlet
Powered by GitBook
On this page

Was this helpful?

  1. Java

Untitled

PreviousCMakeNextCertificates

Last updated 4 years ago

Was this helpful?

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 help me added a resources folder in intellij project

Get OS type:

  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();
}

`

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

https://crunchify.com/how-to-add-resources-folder-properties-at-runtime-into-intellijs-classpath-adding-property-files-to-classpath/
The difference between System.load and System.loadLibrary in Java
Logo