title: Trouble in Setting Java Environment Path on Ubuntu (libjvm.so: cannot open shared object file: No such file or directory)
body: <p>Found the solution!</p>
  
  <p>Ubuntu by default ignore the command "RD_LIBRARY_PATH" therefore I need to add those codes in ".bashrc" instead of "/etc/environment" or .profile.</p>
  
  <p>it now work perfectly fine!</p>
  
  <hr>
  
  <p>I am trying to run a program that reads Java method from C/C++ code. (I made it on Windows successfully, now, I am working on Linux)</p>
  
  <p>I made it successfully compiled and run on Ubuntu, however, the problem is..
  Whenever I try to run the program, I have to type following commands on terminal..</p>
  
  <pre><code>source /etc/environment
  ./invoke #program name is invoke
  </code></pre>
  
  <p>If I do not type "source /etc/environment" every time I boot my PC, the error message I get is...</p>
  
  <pre><code>error while loading shared libraries: libjvm.so: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>Ok. Here is what I added in /etc/environment </p>
  
  <pre><code>export PATH="$PATH:/usr/lib/jvm/jdk1.7.0_25_x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
  export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_25_x64
  export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64:$JAVA_HOME/jre/lib/amd64/server
  </code></pre>
  
  <p>What I want is that, as you know, I want to run the program without typing "source /etc/environment".
  I also tried typing those PATHs on /etc/profile, but result was same... I should type "source /etc/profile" every time I reboot my PC.. </p>
  
  <p>How to make it permanently applied to whole range of System without typing "source /etc/environment" stuffs everytime I boot?</p>
  
  <p>if you need to see source code of the program, here is downloadable address:
  <a href="http://cfile237.uf.daum.net/attach/247819495212DF1C07B9EB" rel="nofollow">http://cfile237.uf.daum.net/attach/247819495212DF1C07B9EB</a></p>