Default Java library path?

2mac picture 2mac · Nov 18, 2013 · Viewed 50.6k times · Source

I understand that you can set the Java library path with an option (-Djava.library.path=/path/to/libs) before executing the program, but is there a place on the system where Java looks if you don't set it manually?

Answer

Matt Ball picture Matt Ball · Nov 18, 2013

Its default value depends on the operating system:

  • On Windows, it maps to PATH
  • On Linux, it maps to LD_LIBRARY_PATH
  • On OS X, it maps to DYLD_LIBRARY_PATH