1
votes

To my understanding, java.library.path sets the .so or .dll native library for JVM. If we want to tell JVM the our java file jar path, we can use -classpath.

I happened to see an service which uses java.library.path and that path contains many java jars such as -Djava.library.path=:/env/service/lib. And /env/service/lib contains the services dependency java jar files. So my questions is: if we sets the java.library.path to a a folder containing dependency java jar files, does JVM classloader recognize them?

1

1 Answers

0
votes

The JVM classloader typically only uses the classpath. It doesn't use other paths. e.g the PATH for finding commands.

The PATH, the java.library.path and classpath can all use the same directory, or not.