com.jniwrapper
package contains classes that allow calling native functions from Java(TM) code.
Calling native functions is quite simple if you follow these steps:
DefaultLibraryLoader
contains all your PATH
entries and
gives you ability to add your own:
DefaultLibraryLoader.getInstance().addPath(new File("path/to/my/code"));As the name suggests this class is used by default to load native libraries.
LongInt retVal = new LongInt(0); WideString str = new WideString(256); UInt32 len = new UInt32(256);
Library kernel = new Library("kernel32"); kernel.getFunction("GetCurrentDirectoryW", null).invoke(retVal, len, new Pointer.OutOnly(str));
System.out.println("Current working directory is: " + str.getValue());