title: jni in linux(Cent6): Exception in thread "main" java.lang.UnsatisfiedLinkError
body: <p>I'm now working with JNI.</p>
  
  <p>I did things below:</p>
  
  <ol>
  <li><p>I made HelloJNI.java. It simply link library libhello.so.</p>
  
  <pre><code>static {
    System.loadLibrary("hello");
  }
  </code></pre></li>
  </ol>
  
  <p>like this. of course I have body also, but nothing special.</p>
  
  <ol>
  <li><p>then I made class file, C file and header file.
  I commanded</p>
  
  <pre><code>#javac HelloJNI.java
  #javah -classpath /usr/guest/workspace/path/ -jni package.HelloJNI
  no errors till now.
  </code></pre></li>
  <li><p>I made libhello.so.</p>
  
  <pre><code># gcc -shared -fpic -o libhello.so -I/usr/java/jdk1.7.0_21/include -I/usr/java/jdk1.7.0_21/include/linux HelloJNI.c
  </code></pre></li>
  <li><p>When I run this project in eclipse, error appears like below.</p>
  
  <pre><code>Exception in thread "main" java.lang.UnsatisfiedLinkError: no hello in java.library.path
      at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
      at java.lang.Runtime.loadLibrary0(Runtime.java:845)
      at java.lang.System.loadLibrary(System.java:1084)
      at org.owls.jni.HelloJNI.&lt;clinit&gt;(HelloJNI.java:7)
  </code></pre></li>
  </ol>
  
  <p>I've tried this one, but does not work.</p>
  
  <pre><code>    # chcon -t texrel_shlib_t libhello.so
  </code></pre>
  
  <p>Thanks for reading and your wise solutions:D</p>
  
  <ul>
  <li>somebody talk about PATH thing. but I can not understand where to put that line. </li>
  </ul>