title: no swt-mozilla-gtk-4332 in java.library.path
body: <p>(See update at bottom for new information.)</p>
  
  <p>I have a Java SWT application that includes an integrated browser.</p>
  
  <p>Everything works fine on Windows and on CENTOS 6.5. I was asked to get the application to work on a new computer to which I installed CENTOS 7.</p>
  
  <p>I keep receiving the no swt-mozilla-gtk-4332 in java.library.path error message.</p>
  
  <p>I am aware of the various pages that talk on this issue. For instance:</p>
  
  <p>StackOverflow <a href="https://stackoverflow.com/questions/10165693">10165693</a>, <a href="https://stackoverflow.com/questions/6418568">6518568</a>, <a href="https://stackoverflow.com/questions/7130980">7130980</a></p>
  
  <p><a href="https://jazz.net/forum/questions/6754/unsatisfiedlinkerror-no-swt-mozilla-gtk-3349-or-swt-mozilla" rel="nofollow noreferrer">Jazz.net</a>, <a href="http://www.eclipse.org/swt/faq.php#browserlinux" rel="nofollow noreferrer">Eclipse.org</a></p>
  
  <p>I am using Firefox 24.8.0. That came with CENTOS 7. I just updated all the software too.</p>
  
  <p>The references indicated that I should have OpenJDK, which I do. That is the only version that can execute Java.</p>
  
  <p>I installed per another recommendation xulrunner (yum install xulrunner).</p>
  
  <p>I set: MOZILLA_FIVE_HOME=/usr/lib/mozilla
  (Some say to use that others say not to. I tried both. Also, one issue said to point to that to "/usr/lib64/xulrunner" less the double quotes, but that did not work. Yes, this folder exists.)</p>
  
  <p>587 people and counting gave thumbs up to the Ubuntu solution of:</p>
  
  <pre><code>ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86_64/
  </code></pre>
  
  <p>There is no jni folder, and any ways that option did not work.</p>
  
  <p>As I mentioned there is only one a program, so</p>
  
  <pre><code>sudo update-alternatives --config java
  </code></pre>
  
  <p>was of no use.</p>
  
  <p>What could the problem be and how to solve it? Since the CENTOS 6.5 machine works (maybe because of a missing software package?) and 7 does not, it cannot be just that I need to add something to my jar file, as it worked before.</p>
  
  <p>Note: here is my /etc/profile.d/java.sh file content:</p>
  
  <pre><code>export MOZILLA_FIVE_HOME=/usr/lib/mozilla
  export LD_LIBRARY_PATH=${MOZILLA_FIVE_HOME}:${LD_LIBRARY_PATH}
  </code></pre>
  
  <p>Here is the actual error output.</p>
  
  <pre class="lang-html prettyprint-override"><code>Exception in thread "main" java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
  Caused by: org.eclipse.swt.SWTError: No more handles [MOZILLA_FIVE_HOME='/usr/lib/mozilla'] (java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
      no swt-mozilla-gtk-4332 in java.library.path
      no swt-mozilla-gtk in java.library.path
      /home/hts/.swt/lib/linux/x86_64/libswt-mozilla-gtk-4332.so: libxpcom.so: cannot open shared object file: No such file or directory
      Can't load library: /home/hts/.swt/lib/linux/x86_64/libswt-mozilla-gtk.so
  )
      at org.eclipse.swt.SWT.error(Unknown Source)
      at org.eclipse.swt.browser.Mozilla.initMozilla(Unknown Source)
      at org.eclipse.swt.browser.Mozilla.create(Unknown Source)
      at org.eclipse.swt.browser.Browser.&lt;init&gt;(Unknown Source)
      at prjNetAccelerator.AppMain.createContents(Unknown Source)
      at prjNetAccelerator.AppMain.open(Unknown Source)
      at prjNetAccelerator.AppWrapper.doLaunch(Unknown Source)
      at prjNetAccelerator.AppWrapper.main(Unknown Source)
      ... 5 more
  Caused by: java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
      no swt-mozilla-gtk-4332 in java.library.path
      no swt-mozilla-gtk in java.library.path
      /home/hts/.swt/lib/linux/x86_64/libswt-mozilla-gtk-4332.so: libxpcom.so: cannot open shared object file: No such file or directory
      Can't load library: /home/hts/.swt/lib/linux/x86_64/libswt-mozilla-gtk.so
  
      at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
      at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
      ... 12 more
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p>The error text showed the problem, namely that the system could not find libxpcom.so. Mozilla (xulruntime) in version 22.0 replaced the files, libxpcom.so and mozsqlite3.so, with libxul.so. The file, libsmozsqlite3.so stayed for a few more versions than disappeared as well. All other files are the same as version 28.x, which is the current version as of today (2014.09.18).</p>
  
  <p>The integrated SWT browser for some reason wants the older version, even though it is not there. The questions are:</p>
  
  <ul>
  <li>What is the mechanism that SWT determines which version of the Gecko GTK+ / xulrunner to use?</li>
  <li>Would a newer version of SWT, although I thought that my version with Eclipse Kepler was current, solve the problem?</li>
  <li>How do I get SWT to target the new version?</li>
  <li>Is the problem Firefox or Chrome or what related?</li>
  </ul>
  
  <p>I understand most of the problem now, but not all of it.</p>
  
  <p>I see that Eclipse is at Luna now, so that may solve the problem, have to check. That usually means an updated SWT library. I really thought that Java was version independent, but I guess not entirely.</p>