You can set the system properties using the -D option when invoking the Java virtual machine at the command line:
java -Djna.library.path=<path to your library> MainClass
You can also set this programmatically in your code when starting your applications when it was read, for example. configuration file:
System.setProperty("jna.library.path", <path to your library>);
I have not used JNA myself, so I donβt know if it is too late for the JVM when you set the value in the code. In this case, go to the first option.
source share