title: compile 32bit program on ubuntu 64bit (libjvm.so problems)
body: <p>SOLVED</p>
  
  <p>I just installed "sudo apt-get install gcc-multilib" and it allowed to compile succesfully using the following command:</p>
  
  <p>gcc -m32  -o invoke -I$JAVA_HOME/include -I$JAVA_HOME/include/linux cCode.c $JAVA_HOME/jre/lib/i386/server/libjvm.so</p>
  
  <h2>Than you very much all!</h2>
  
  <p>Here is downloadable source code:
  <a href="http://cfile237.uf.daum.net/attach/247819495212DF1C07B9EB" rel="nofollow">http://cfile237.uf.daum.net/attach/247819495212DF1C07B9EB</a></p>
  
  <p>well, first, my ubuntu is 64bit 12.04LTS.
  and, I installed both 64 and 32bit version of latest jdk 1.7.0_25.</p>
  
  <p>I tried to compile the source code above using 32 bit library of jdk version on my 64bit Ubuntu, it shows a following error:</p>
  
  <pre><code>/usr/lib/jvm/jdk1.7.0_25_x86/jre/lib/i386/server/libjvm.so: could not read symbols: File in wrong format
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>However, if I try to compile those source code using 64 bit library of jdk version, it compiles fine and run very well.</p>
  
  <p>My problem is, as you know, how would I make it compile and run well using 32 bit version of jdk library on 64bit Ubuntu platform?</p>
  
  <p>AH, before I compile, I always typed following commands on Terminal,</p>
  
  <p>for 32 bit compile</p>
  
  <pre><code>export PATH=$PATH:/usr/lib/jvm/jdk1.7.0_25_x86/bin
  export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_25_x86
  export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/i386:$JAVA_HOME/jre/lib/i386/server
  </code></pre>
  
  <p>for 64 bit compile</p>
  
  <pre><code>export PATH=$PATH:/usr/lib/jvm/jdk1.7.0_25_x64/bin
  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>