Hello World SWT - Could not load SWT library [message #754988] |
Sun, 06 November 2011 12:59 |
willem Messages: 2 Registered: November 2011 |
Junior Member |
|
|
Hello All,
I just "installed" Eclipse for RCP and RAP Developers and wanted to do the "Hello World SWT" tutorial.
I am getting the following error when i run the application.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-win32-3738 in java.library.path
no swt-win32 in java.library.path
Can't load library: C:\Users\Willem\.swt\lib\win32\x86\swt-win32-3738.dll
Can't load library: C:\Users\Willem\.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:13)
I think this might has something to do with my %PATH% variable, or my runtime environment , but i'm not really sure.
I downloaded the latest java JDK from the oracle site ( Java SE 7u1 )
I updated my eclipse.ini , as suggested in the newcomers sticky .
My eclipse.ini file looks like this:
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
-product
org.eclipse.epp.package.rcp.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
C:\Program Files\Java\jdk1.7.0_01\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
I am running windows 7 professional 32 bit.
Any help would be greatly appreciated, thanks in advanced !
[Updated on: Sun, 06 November 2011 14:30] Report message to a moderator
|
|
|
Re: Hello World SWT - Could not load SWT library [message #754994 is a reply to message #754988] |
Sun, 06 November 2011 14:16 |
|
On 2011.11.06 5:59, willem wrote:
> Hello All,
>
> I just "installed" Eclipse for RCP and RAP Developers and wanted to do
> the "Hello World SWT" tutorial.
>
> [snip]
>
> I updated my eclipse.ini , as suggested in the newcomers sticky .
> My eclipse.ini file looks like this:
> -startup
> plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
> --launcher.library
> plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
> -product
> org.eclipse.epp.package.rcp.product
> --launcher.defaultAction
> openFile
> --launcher.XXMaxPermSize
> 256M
> -showsplash
> org.eclipse.platform
> --launcher.XXMaxPermSize
> 256m
> --launcher.defaultAction
> openFile
> -vmargs
> -Dosgi.requiredJavaVersion=1.5
> -Xms40m
> -Xmx512m
> -vm
> C:\Program Files\Java\jdk1.7.0_01\bin\javaw.exe
> I added the last two lines, but that doesn't seem to do anything.
> I am running windows 7 professional 32 bit.
>
> Any help would be greatly appreciated, thanks in advanced !
Hey, this may be a little off-topic (i.e.: it may not cure your original
complaint), but I'm pretty sure that you must put
-vm
C:\Program Files\Java\jdk1.7.0_01\bin\javaw.exe
before the -vmargs section in eclipse.ini.
|
|
|
|
|
Re: Hello World SWT - Could not load SWT library [message #762787 is a reply to message #761182] |
Thu, 08 December 2011 16:16 |
Heimdall Messages: 3 Registered: December 2011 |
Junior Member |
|
|
The solution didn't work for me. First it told me that it couldn't add the project that was already there, org.eclipse.swt. So I deleted org.eclipse.swt and org.eclipse.swt.win32.win32.x86 and tried that import again. But it only added org.eclipse.swt and not org.eclipse.swt.win32.win32.x86, which I still had to add again the way the tutorial tells. Not working, so again I tried just deleting org.eclipse.swt and following the "solution" instructions again.
After another whinge that swt-win32-3738 was not found (even thought it is in Workspace\org.eclipse.swt.win32.win32.x86 as a .dll), I picked on the message Can't load library: .swt\lib\win32\x86\swt-win32-3738.dll and copied the file there. Now it works. But something doesn't feel right.
It seems to me that this is not meant to be the solution. If the file belongs there, why wasn't it there in the first place? If it doesn't, my solution is dirty/messy, especially is I have to do the same thing again and again. Anyway, the file is in the root of the project org.eclipse.swt.win32.win32.x86, so why wasn't it used from there? Does it really belong there? Are some paths set wrong? Is the problem in the project itself or in Eclipse?
In short - what is wrong / what am I doing wrong? Help!
Tom
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.11258 seconds