My native library resides at C:\Mywork
.
How do I set the native library path towards C:\Mywork
using both command prompt line and the path variable?
Native libraries are platform-specific library files, including . dll, . so, or *SRVPGM objects, that can be configured within shared libraries. Native libraries are visible to an application class loader whenever the shared library is associated with an application.
java. library. path is a System property, which is used by Java programming language, mostly JVM, to search native libraries, required by a project.
Go to Project properties->Java Build Path->Source. You'll find a list of source-folders. Each entry under the the Source tab has Native library locations.
Start -> Control Panel -> System -> Advanced. Click on Environment Variables, under System Variables, find PATH, and click on it. In the Edit windows, modify PATH by adding the location of the class to the value for PATH.
In the PATH variable as follows:
C:\> set PATH=%PATH%;C:\Mywork
And on the java command-line like so:
C:\> java -Djava.library.path=C:\Mywork MyMainClass
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With