-1

Oracle Java 1.8 does not lookup /usr/lib/x86_64-linux-gnu/ folder to load native library.

I have installed OpenSSL library, which is installed in /usr/lib/x86_64-linux-gnu/ folder, however while loading from Java using System.loadLibrary(), only lookup path were

/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib

Am I missing some configuration? Updating env LD_LIBRARY_PATH works but preferred programmatic approach to avoid additional steps.

EDIT

Agreed. programmatic hack is not sustainable option. Running native executable does loads library from the arch /usr/lib/x86_64-linux-gnu/ folder. Java not looking in arch folder.

1 Answers1

0

I think that programmatic way is bad idea. What you will be doing on another platforms???

I see two ways to solve this problem

  1. Using LD_LIBRARY_PATH
  2. Create symlink in standard directories for your library
Ibes
  • 21
  • 2
  • Let me rephrase, By programmatic i mean was to avoid additional configuration step. Basically, how Java skips the lookup in the arch folder? – Vishwajeet Dusane Jul 26 '17 at 09:03