While technically correct these answers are missleading. Setting the environment variables PATH on Windows, or LD_LIBRARY_PATH on unix will change where the jvm looks for libraries:
What is LD_LIBRARY_PATH and how to use it?
on linux:
export LD_LIBRARY_PATH=/usr/.../
then:
java ....