title: RPATH is not used for java JNI library
body: <p>It is a CentOS 7.5 aarch64 box. I installed gcc 6.1 in my directory /opt/build, and used the new version to build a jni library, with -Wl,-rpath=/opt/build/lib.<br>
  So the jni library was bound to /opt/build/lib/libstdc++.so.6. I have doubled checked that with ldd and chrpath.<br>
  Then I used java -jar app.jar to try it. </p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/app/lib/libmylib.so.3.14.0: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /opt/app/lib/libmylib.so.3.14.0)</p>
  </blockquote>
  
  <p>It is clear that /opt/app/lib/libmylib.so.3.14.0 will try to link to /lib64/libstdc++.so.6 even if the RPATH is set to /opt/build/lib.</p>
  
  <p>Don't know why...</p>