?
Solved

Getting "libgtk-x11-2.0.so.0: cannot open shared object file" on Linux

Posted on 2011-03-03
10
Medium Priority
?
6,585 Views
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.

(libgtk-x11-2.0.so.0: 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?

FULL ERROR
[wsadmin@rnd1aasr01:/tmp/sibexplorer_1.01b]:> ./sibexplorer.sh
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 (libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory)
        swt-pi-gtk (Not found in java.library.path)
        /tmp/swtlib-32/libswt-pi-gtk-3655.so (libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory)
        /tmp/swtlib-32/libswt-pi-gtk.so (/tmp/swtlib-32/liblibswt-pi-gtk.so.so: 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(J9VMInternals.java:200)
        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(J9VMInternals.java:200)
        at com.ibm.ws.sib.tools.explorer.SIBExplorer.go(SIBExplorer.java:192)
        at com.ibm.ws.sib.tools.explorer.SIBExplorer.main(SIBExplorer.java:87)
0
Comment
Question by:lphillips
10 Comments
 
LVL 16

Expert Comment

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

Author Comment

by:lphillips
ID: 35027905
Redhat.
0
 
LVL 16

Expert Comment

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

yum install libgtk-java
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 12

Accepted Solution

by:
upanwar earned 1000 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 libgtk-x11-2.0.so.0

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

Assisted Solution

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

yum install gtk2-devel
0
 

Author Comment

by:lphillips
ID: 35029029
Medvedd -
Do I need those packages you mentioned if I'm using the Java delivered with WebSphere?  The application has a env.sh 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 libgtk-x11-2.0.so.0
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 libgtk-x11-2.0.so.0

0
 
LVL 16

Expert Comment

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

Author Comment

by:lphillips
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.
0
 
LVL 35

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/libgtk-x11-2.0.la
lrwxrwxrwx 1 root root      26 Jul 25  2010 /usr/lib/libgtk-x11-2.0.so -> libgtk-x11-2.0.so.0.1800.9*
lrwxrwxrwx 1 root root      26 Jul 25  2010 /usr/lib/libgtk-x11-2.0.so.0 -> libgtk-x11-2.0.so.0.1800.9*
-rwxr-xr-x 1 root root 3855924 Apr 30  2010 /usr/lib/libgtk-x11-2.0.so.0.1800.9*

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
0
 

Author Closing Comment

by:lphillips
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.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

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 …
A solution for Fortify Path Manipulation.
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
Course of the Month14 days, 7 hours left to enroll

807 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