Here you can find the source of loadLibrary(String libFileName)
public static void loadLibrary(String libFileName)
//package com.java2s; // Licensed to the Apache Software Foundation (ASF) under one import java.io.File; public class Main { /**// w ww. j av a 2s .c o m * Attempts to load the given library from all paths in java.libary.path. * Throws a RuntimeException if the library was unable to be loaded from * any location. */ public static void loadLibrary(String libFileName) { boolean found = false; String javaLibPath = System.getProperty("java.library.path"); for (String path : javaLibPath.split(":")) { File libFile = new File(path + File.separator + libFileName); if (libFile.exists()) { System.load(libFile.getPath()); found = true; break; } } if (!found) { throw new RuntimeException("Failed to load " + libFileName + " from any " + "location in java.library.path (" + javaLibPath + ")."); } } }