Home » Newcomers » Newcomers » SWT Tutorial fails at RunAs (Could not load SWT library)(fails to load some swt*dlls from eclipse installation)
SWT Tutorial fails at RunAs (Could not load SWT library) [message #995532] |
Sun, 30 December 2012 11:28 |
mario semo Messages: 2 Registered: December 2012 |
Junior Member |
|
|
Hello,
i've installed eclipse-rcp-juno-SR1-win32.zip and performed the Console Hello World and 90% of the SWT Hello World. The HelloWorldSWT compiles fine, but running the app results in:
SWT Sample
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-win32-4234 in java.library.path
no swt-win32 in java.library.path
Can't load library: C:\Dokumente und Einstellungen\ms\.swt\lib\win32\x86\swt-win32-4234.dll
Can't load library: C:\Dokumente und Einstellungen\ms\.swt\lib\win32\x86\swt-win32.dll
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:331)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:240)
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:14)
i found the swt-win32-4234.dll in my exclipse installation and copied it somewhere into my PATH (i have c:\mydlls in the path, and thats where i copied the 2 files to).
Verzeichnis von P:\Programme\eclipse\configuration\org.eclipse.osgi\bundles\363\1\.cp
30.12.2012 10:24 438.272 swt-win32-4234.dll
30.12.2012 10:24 118.784 swt-gdip-win32-4234.dll
Now the HelloWorldSWT executes and opens a windows.
But now i am a bit confused if this is what i have to do? What am i missing?
Next i looked into the "Problems" view which shows me some warnings, and i am not sure, if this is ok:
Description Resource Path Location Type
The method removeEventListener(OleAutomation, GUID, int, OleListener) from the type OleControlSite is deprecated IE.java /org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/browser line 1964 Java Problem
There is no 'jre.compilation.profile' build entry and the project has Java compliance preferences set build.properties /org.eclipse.swt.win32.win32.x86 line 1 Plug-in Problem
The method removeEventListener(OleAutomation, GUID, int, OleListener) from the type OleControlSite is deprecated IE.java /org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/browser line 1963 Java Problem
The method removeEventListener(OleAutomation, GUID, int, OleListener) from the type OleControlSite is deprecated IE.java /org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/browser line 1966 Java Problem
The method removeEventListener(OleAutomation, GUID, int, OleListener) from the type OleControlSite is deprecated IE.java /org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/browser line 1965 Java Problem
The method removeEventListener(OleAutomation, GUID, int, OleListener) from the type OleControlSite is deprecated IE.java /org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/browser line 1968 Java Problem
The method removeEventListener(OleAutomation, GUID, int, OleListener) from the type OleControlSite is deprecated IE.java /org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/browser line 1967 Java Problem
The method removeEventListener(OleAutomation, GUID, int, OleListener) from the type OleControlSite is deprecated IE.java /org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/browser line 1970 Java Problem
The method removeEventListener(OleAutomation, GUID, int, OleListener) from the type OleControlSite is deprecated IE.java /org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/browser line 1969 Java Problem
The method removeEventListener(OleAutomation, GUID, int, OleListener) from the type OleControlSite is deprecated IE.java /org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/browser line 1972 Java Problem
The method getPeer() from the type Component is deprecated SWT_AWT.java /org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/awt line 196 Java Problem
The method removeEventListener(OleAutomation, GUID, int, OleListener) from the type OleControlSite is deprecated IE.java /org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/browser line 1971 Java Problem
The method removeEventListener(OleAutomation, GUID, int, OleListener) from the type OleControlSite is deprecated IE.java /org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/browser line 1974 Java Problem
The method removeEventListener(OleAutomation, GUID, int, OleListener) from the type OleControlSite is deprecated IE.java /org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/browser line 1973 Java Problem
Build path specifies execution environment CDC-1.0/Foundation-1.0. There are no JREs installed in the workspace that are strictly compatible with this environment. org.eclipse.swt.win32.win32.x86 Build path JRE System Library Problem
Resource leak: 'jar' is never closed Library.java /org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal line 185 Java Problem
Finally i tried to start the HelloWorldSWT from a command line.
so i changed to the Workspace\HelloWorldSWT\bin and run:
D:\LCo3\Workspace\HelloWorldSWT\bin>javaw HelloWorldSWT
but here i get some errors regarding SWT Classes:
D:\LCo3\Workspace\HelloWorldSWT\bin>Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Display
at HelloWorldSWT.main(HelloWorldSWT.java:14)
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.widgets.Display
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more
i guess i have to add something to my CLASSPATH. i tried:
D:\LCo3\Workspace\org.eclipse.swt.win32.win32.x86\bin;
and now "javaw HelloWorldSWT" opens the Windows.
Is this changed Classpath correkt?
thx very much for any help for a java/eclipse/swt newcomer.
mario.
|
|
|
Re: SWT Tutorial fails at RunAs (Could not load SWT library) [message #997407 is a reply to message #995532] |
Mon, 07 January 2013 10:42 |
|
Hi Mario,
First, I see that you have an issue regarding the configuration of the Java Runtime Environment of your Java project:
Quote:Build path specifies execution environment CDC-1.0/Foundation-1.0. There are no JREs installed in the workspace that are strictly compatible with this environment. org.eclipse.swt.win32.win32.x86 Build path JRE System Library Problem
While it may not be the cause of your problem, you can easily change the JRE that your project is using to fix this.
Now, for the root of your problem, a quick search is suggesting that the issue lies in the dependency between your code and SWT. As Craig Williams is suggesting it in this message:
Quote:the solution lay in the step of the tutorial titled 'Configure the Java project'. Go into the project Properties and select Java Build Path then make sure you are in the Projects tab where you added the SWT project earlier. Expand the reference to the SWT project. Where is says Native library location I found that when I followed the tutorial it said (None). I clicked Edit and found the SWT project in my workspace obviously when I added it earlier in the tutorial. Select this and click OK.
Regards,
Stephane Begaudeau, Obeo
--
Twitter: @sbegaudeau
Google+: +stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com | Eclipse Java Development Tools Tips and Tricks
|
|
| |
Goto Forum:
Current Time: Tue Mar 19 08:05:34 GMT 2024
Powered by FUDForum. Page generated in 0.03508 seconds
|