Getting " cannot open shared object file" on Linux

Posted on 2011-03-03
Last Modified: 2012-05-11
I'm getting the following error when trying to run an application on Linux version 2.6.18-164.el5.

( cannot open shared object file: No such file or directory)

After a lot of googling it seems to be more about linux vs. the actual program I'm trying to run, as a lot of people are getting this with many different applications.  I have confirmed the files it is looking for (listed below in full error) are there, and permissions allow access to them.

Does anyone have any idea what I need to do to resolve this?

[wsadmin@rnd1aasr01:/tmp/sibexplorer_1.01b]:> ./
Service Integration Bus Explorer Version: 1.01b
(C) Copyright IBM Corp. 2006
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
        swt-pi-gtk-3655 ( cannot open shared object file: No such file or directory)
        swt-pi-gtk (Not found in java.library.path)
        /tmp/swtlib-32/ ( cannot open shared object file: No such file or directory)
        /tmp/swtlib-32/ (/tmp/swtlib-32/ cannot open shared object file: No such file or directory)

        at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
        at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
        at org.eclipse.swt.internal.gtk.OS.<clinit>(Unknown Source)
        at java.lang.J9VMInternals.initializeImpl(Native Method)
        at java.lang.J9VMInternals.initialize(
        at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
        at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
        at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
        at java.lang.J9VMInternals.initializeImpl(Native Method)
        at java.lang.J9VMInternals.initialize(
Question by:lphillips
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 16

Expert Comment

ID: 35027827
What flavor of Linux you are running (Redhat, Centos, Ubuntu..)?

Author Comment

ID: 35027905
LVL 16

Expert Comment

ID: 35027930
You need to install libgtk-java package:

yum install libgtk-java
Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

LVL 12

Accepted Solution

upanwar earned 250 total points
ID: 35027953
I have seen that you are using the RHEL 5 or its clone so you can know the package which containes the the library file by executing the below given command and then install that package to fix your issue.

# rpm -q --redhatprovides

you need rpmdb-redhat package to be installed on your system to use this option.
LVL 16

Assisted Solution

medvedd earned 250 total points
ID: 35027973
Oops, libgtk-java is not enough. You also need gtk2-devel:

yum install gtk2-devel

Author Comment

ID: 35029029
Medvedd -
Do I need those packages you mentioned if I'm using the Java delivered with WebSphere?  The application has a which ask for the WebSphere directory, so it can locate the Java it wants to use.

Upanwa -
I get the following error when I run that command, but I am not root so I don't know if that has something to do with it.  I have asked the unix admins to run it and see if they get a different output.  Here is what I got:

[wsadmin@rnd1aasr01:/home/wsadmin]:> rpm -q --redhatprovides
error: cannot open Packages index using db3 - No such file or directory (2)
error: cannot open Packages database in /usr/lib/rpmdb/x86_64-redhat-linux/redhat
no package provides

LVL 16

Expert Comment

ID: 35029431
Those packages will not interfere with your java, they just provide
interface between java and gtk

Author Comment

ID: 35029780
I am going to get the unix admin to help me get the lib and packages installed and will update this thread then.  Hopefully that will happen in the next couple of hours.  I will keep you posted.
LVL 34

Expert Comment

by:Duncan Roe
ID: 35047531
The following files need to exist on your system:
07:31:41$ ls -Fl /usr/lib/libgtk-x11*
-rw-r--r-- 1 root root     956 Apr 30  2010 /usr/lib/
lrwxrwxrwx 1 root root      26 Jul 25  2010 /usr/lib/ ->*
lrwxrwxrwx 1 root root      26 Jul 25  2010 /usr/lib/ ->*
-rwxr-xr-x 1 root root 3855924 Apr 30  2010 /usr/lib/*

Open in new window

If the files are not present, you should contact your Linux sysadmins to get them installed. The package will have a name starting with or containing gtk+2-2

Author Closing Comment

ID: 35057067
I ended up needing both packages/libraries that were suggested by you two.  I'm still having an issue, but it appears to be my xwindows client (although xclock works).  Because the unix admin tried it as my user from his machine and it worked.

Thanks you for your help.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
base64 decode encode 12 195
eclipse java  build path 6 81
ejb mdb examples 1 38
activeMQ Queue Messages Enqueued and Messages Dequeued 1 115
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question