Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Cairo on HPUX. "Unable to load graphics library" Exception when running SWT application on(Cairo on HPUX "Unable to load graphics library" Exception when running SWT application on HPUX 11i v2.)
Cairo on HPUX. "Unable to load graphics library" Exception when running SWT application on [message #753106] Wed, 26 October 2011 16:31 Go to next message
Milan Vahala is currently offline Milan VahalaFriend
Messages: 7
Registered: October 2011
Junior Member
Hi,
I'm using SWT 3.6.2 (swt-3.6.2-motif-hpux-ia64_32) on HPUX 11i v2.
When I run simple SWT application using Cairo (SWT Snippet281 - draw a multi-gradient) I get following exception:

Exception in thread "main" org.eclipse.swt.SWTException: Unable to load graphics library [Cairo required] (java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-cairo-motif-3659 in java.library.path
no swt-cairo-motif in java.library.path
Can't load library: /var/tmp/swtlib-32/libswt-cairo-motif-3659.so
Can't load library: /var/tmp/swtlib-32/libswt-cairo-motif.so
)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.graphics.Device.checkCairo(Unknown Source)
at org.eclipse.swt.graphics.Pattern.<init>(Unknown Source)
at org.eclipse.swt.graphics.Pattern.<init>(Unknown Source)
at org.eclipse.swt.snippets.Snippet281$1.handleEvent(Snippet281.java:38)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Composite.XExposure(Unknown Source)
at org.eclipse.swt.widgets.Canvas.XExposure(Unknown Source)
at org.eclipse.swt.widgets.Shell.XExposure(Unknown Source)
at org.eclipse.swt.widgets.Widget.windowProc(Unknown Source)
at org.eclipse.swt.widgets.Display.windowProc(Unknown Source)
at org.eclipse.swt.internal.motif.OS._XtDispatchEvent(Native Method)
at org.eclipse.swt.internal.motif.OS.XtDispatchEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.update(Unknown Source)
at org.eclipse.swt.widgets.Shell.setVisible(Unknown Source)
at org.eclipse.swt.widgets.Shell.open(Unknown Source)
at org.eclipse.swt.snippets.Snippet281.main(Snippet281.java:53)
Caused by: java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-cairo-motif-3659 in java.library.path
no swt-cairo-motif in java.library.path
Can't load library: /var/tmp/swtlib-32/libswt-cairo-motif-3659.so
Can't load library: /var/tmp/swtlib-32/libswt-cairo-motif.so

at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.cairo.Cairo.<clinit>(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:173)
... 19 more

I have Cairo library installed.
The problem seems to be caused by libswt-cairo-motif-3659.so missing in SWT.
swt.jar on Linux and AIX contains libswt-cairo-motif-3659.so file but in HPUX swt.jar it's missing.
Is this the problem and SWT on HPUX does not support Cairo functionality or is problem somewhere else?

Thanks,
Milan
Re: Cairo on HPUX. &quot;Unable to load graphics library&quot; Exception when running SWT ap [message #754290 is a reply to message #753106] Tue, 01 November 2011 20:36 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
Registered: July 2009
Senior Member
Hi,

Yes, this is the problem, swt's hpux port does not provide the required
library. This should definitely change in the eclipse/swt 3.8 release,
because one of its major work items is to change all graphics work on
gtk to use cairo (the hpux port only comes in a gtk flavour as of
eclipse 3.7). Sorry that this does not help with your current 3.6.2
install.

Grant


On 10/26/2011 12:31 PM, Milan Vahala wrote:
> Hi,
> I'm using SWT 3.6.2 (swt-3.6.2-motif-hpux-ia64_32) on HPUX 11i v2.
> When I run simple SWT application using Cairo (SWT Snippet281 - draw a
> multi-gradient) I get following exception:
>
> Exception in thread "main" org.eclipse.swt.SWTException: Unable to load
> graphics library [Cairo required] (java.lang.UnsatisfiedLinkError: Could
> not load SWT library. Reasons: no swt-cairo-motif-3659 in java.library.path
> no swt-cairo-motif in java.library.path
> Can't load library: /var/tmp/swtlib-32/libswt-cairo-motif-3659.so
> Can't load library: /var/tmp/swtlib-32/libswt-cairo-motif.so
> )
> at org.eclipse.swt.SWT.error(Unknown Source)
> at org.eclipse.swt.graphics.Device.checkCairo(Unknown Source)
> at org.eclipse.swt.graphics.Pattern.<init>(Unknown Source)
> at org.eclipse.swt.graphics.Pattern.<init>(Unknown Source)
> at org.eclipse.swt.snippets.Snippet281$1.handleEvent(Snippet281.java:38)
> at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
> at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
> at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
> at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
> at org.eclipse.swt.widgets.Composite.XExposure(Unknown Source)
> at org.eclipse.swt.widgets.Canvas.XExposure(Unknown Source)
> at org.eclipse.swt.widgets.Shell.XExposure(Unknown Source)
> at org.eclipse.swt.widgets.Widget.windowProc(Unknown Source)
> at org.eclipse.swt.widgets.Display.windowProc(Unknown Source)
> at org.eclipse.swt.internal.motif.OS._XtDispatchEvent(Native Method)
> at org.eclipse.swt.internal.motif.OS.XtDispatchEvent(Unknown Source)
> at org.eclipse.swt.widgets.Display.update(Unknown Source)
> at org.eclipse.swt.widgets.Shell.setVisible(Unknown Source)
> at org.eclipse.swt.widgets.Shell.open(Unknown Source)
> at org.eclipse.swt.snippets.Snippet281.main(Snippet281.java:53)
> Caused by: java.lang.UnsatisfiedLinkError: Could not load SWT library.
> Reasons: no swt-cairo-motif-3659 in java.library.path
> no swt-cairo-motif in java.library.path
> Can't load library: /var/tmp/swtlib-32/libswt-cairo-motif-3659.so
> Can't load library: /var/tmp/swtlib-32/libswt-cairo-motif.so
>
> at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
> at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
> at org.eclipse.swt.internal.cairo.Cairo.<clinit>(Unknown Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:173)
> ... 19 more
>
> I have Cairo library installed. The problem seems to be caused by
> libswt-cairo-motif-3659.so missing in SWT. swt.jar on Linux and AIX
> contains libswt-cairo-motif-3659.so file but in HPUX swt.jar it's missing.
> Is this the problem and SWT on HPUX does not support Cairo functionality
> or is problem somewhere else?
>
> Thanks,
> Milan
Re: Cairo on HPUX. "Unable to load graphics library" Exception when running SWT applicatio [message #754318 is a reply to message #753106] Wed, 02 November 2011 05:32 Go to previous message
Milan Vahala is currently offline Milan VahalaFriend
Messages: 7
Registered: October 2011
Junior Member
Finally, I was able to find solution to this problem.
I compiled swt-cairo library on HP-UX from sources and added it to swt.jar.
Previous Topic:Make widget transient for tooltip mouseover
Next Topic:Table.setSortColumn sets column background to grey
Goto Forum:
  


Current Time: Fri Nov 28 00:30:12 GMT 2014

Powered by FUDForum. Page generated in 0.02979 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software