Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Examples » SWT Hello World fails(SWT Hello World fails on Indigo, works on Helios)
SWT Hello World fails [message #707841] Tue, 02 August 2011 05:58 Go to next message
A. Rick Anderson is currently offline A. Rick AndersonFriend
Messages: 2
Registered: August 2011
Junior Member
On a WinDoze 7 Pro 32-bit machine, if I follow the instructions for creating a Hello World SWT example, it will work for Helios, but when I try it on Indigo, it fails with the following message:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
	no swt-win32-3735 in java.library.path
	no swt-win32 in java.library.path
	Can't load library: C:\Users\arick\.swt\lib\win32\x86\swt-win32-3735.dll
	Can't load library: C:\Users\arick\.swt\lib\win32\x86\swt-win32.dll

	at org.eclipse.swt.internal.Library.loadLibrary(Library.java:285)
	at org.eclipse.swt.internal.Library.loadLibrary(Library.java:194)
	at org.eclipse.swt.internal.C.<clinit>(C.java:21)
	at org.eclipse.swt.widgets.Display.<clinit>(Display.java:138)
	at HelloWorldSWT.main(HelloWorldSWT.java:12)


The project, org.eclipse.swt.win32.win32.x86 is in the build path of my HelloWorldSWT project. What I don't understand is why it is looking in my home directory for the SWT DLL?
Re: SWT Hello World fails [message #720661 is a reply to message #707841] Wed, 31 August 2011 02:57 Go to previous messageGo to next message
Kevin  is currently offline Kevin Friend
Messages: 2
Registered: August 2011
Junior Member
I don't understand why it is looking in my home directory either. I'm wondering if this is an Indigo bug since you said the same tutorial worked in Helios? My first install of Eclipse was this past weekend, and it happens to be Indigo.

It would be nice if any Eclipse experts who monitor this forum could help us understand what is going wrong.

In the meantime, have you seen the answer by Pete in another thread on this?
[Note. The forum won't let me use a link until I've posted more than 5 messages (not sure why there is such a rule?), so the only way I can include the link I was trying to post is to transpose http to make it not look like a link. Just take my link and transpose ptth back to http to make it valid]ptth://www.eclipse.org/forums/index.php/m/720657/#msg_720657

Pete's answer was very helpful to me. At least it got me past the error and made the application work.

Best of luck to you.

[Updated on: Wed, 31 August 2011 03:02]

Report message to a moderator

Re: SWT Hello World fails [message #892437 is a reply to message #720661] Thu, 28 June 2012 08:35 Go to previous messageGo to next message
Sébastien GUÉRIN is currently offline Sébastien GUÉRINFriend
Messages: 1
Registered: June 2012
Junior Member
So best answer is (works for Eclipse Juno too) :

Pete wrote on Wed, 24 August 2011 07:03
Had Same initial issue and finally sorted it by...

Right click on project and go to Properties

In Java Build Path under the Projects tab there is the associated Project, in my case org.eclipse.swt.win32.win32.x86

Expand this down with the little arrow to the left to display the options. Here I found Native Library Locations. This wasn't set so I selected it and clicked Edit.

In the Popup window that follows, I selected Workspace and then org.eclipse.swt.win32.win32.x86.

Next time I ran the class, it work fine.

I hope this helps someone!


[Updated on: Thu, 28 June 2012 08:37]

Report message to a moderator

Re: SWT Hello World fails [message #915962 is a reply to message #892437] Tue, 18 September 2012 09:56 Go to previous messageGo to next message
t p is currently offline t pFriend
Messages: 1
Registered: September 2012
Junior Member
Thank you, fixed it!
Re: SWT Hello World fails [message #1061309 is a reply to message #892437] Fri, 31 May 2013 07:08 Go to previous messageGo to next message
Gentle Chan is currently offline Gentle ChanFriend
Messages: 2
Registered: May 2013
Junior Member
Laughing
Thank you so much. It finally worked.
Re: SWT Hello World fails [message #1066525 is a reply to message #707841] Tue, 02 July 2013 23:18 Go to previous messageGo to next message
Chris Blythe is currently offline Chris BlytheFriend
Messages: 1
Registered: July 2013
Junior Member
Same problem - fix posted by Sébastien GUÉRIN (petes) worked.
Win 7 pro 64.
Pretty sure I followed the tutorial accurately, have we all gone wrong or is there an issue with the tutorial and Win 7?
icon10.gif  Re: SWT Hello World fails [message #1072919 is a reply to message #892437] Tue, 23 July 2013 19:23 Go to previous messageGo to next message
Jim Marvel is currently offline Jim MarvelFriend
Messages: 1
Registered: July 2013
Junior Member
absolute newbie thanks immensely
Re: SWT Hello World fails [message #1212966 is a reply to message #1066525] Wed, 27 November 2013 03:59 Go to previous message
A. Rick Anderson is currently offline A. Rick AndersonFriend
Messages: 2
Registered: August 2011
Junior Member
It seems like the tutorial is missing a step or Eclipse has a bug. At least it is counter-intuitive to me that eclipse doesn't seem to configure the Native Library Location when you import a project.

I ran into this same issue recently on an iMac, so obviously, the eclipse team believes this is the best behavior.

BTW: On a mac, you need to add, org.eclipse.swt.cocoa.macosx.x86_64, and then point the Native Library Location, just as you do with org.eclipse.swt.{platform}.{os}.{arch}.
Previous Topic:Batch Program Sample
Next Topic:Maven for Eclipse Juno
Goto Forum:
  


Current Time: Sat Nov 22 21:33:01 GMT 2014

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

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