M6 - swt problems

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

M6 - swt problems

Postby jleotta » Fri Apr 08, 2005 10:59 am

Hello,

Well after extensive time wasting I finally got the proper jars into eclipse 3.1M6 to compile code. Now when I run the application its telling me that the swt-win32-3128.dll cannot be loaded. I put the dll's in the same place I did before ie \WINNT\system32 but it still cant find it. Does anyone know where to put the dll's and if Eclipse 3.1M6 needs to know something about their location?

Thanks,
Jim
jleotta
 
Posts: 31
Joined: Tue Aug 03, 2004 9:46 am

Re: M6 - swt problems

Postby Eric Clayberg » Fri Apr 08, 2005 2:00 pm

jleotta wrote:Well after extensive time wasting I finally got the proper jars into eclipse 3.1M6 to compile code.

Note that Designer will automatically set up your project classpath for you if you use the SWT/JFace Project wizard to create the project in M6. If your project was created prior to M6, you need to migate your project yourself.

jleotta wrote:Now when I run the application its telling me that the swt-win32-3128.dll cannot be loaded. I put the dll's in the same place I did before ie \WINNT\system32 but it still cant find it. Does anyone know where to put the dll's and if Eclipse 3.1M6 needs to know something about their location?

Just to be clear...you extracted the three Eclipse SWT DLLs from the new SWT plugin jar file and copied them into your \WINNT\system32 directory? That should work. If not, you should post a question on the Eclipse SWT newsgroup detailing exactly what you did and exactly what error message you are seeing.

It appears that the Eclipse folks might have broken a few things with their M6 release.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

New Methodology

Postby jleotta » Fri Apr 08, 2005 2:51 pm

Hey Eric,

Yes I put the dll's (all three) in the system32 directory as I have always done and they are not found. I posted to the bulletin board the problem as well as have the users and no response all day.

It seems they went to a new methodology for loading jars and dll's and unless its a secret no one seemed to run any tests.

Be well.
jleotta
 
Posts: 31
Joined: Tue Aug 03, 2004 9:46 am

Re: M6 - swt problems

Postby pongs » Sat Apr 09, 2005 9:05 am

Same problem.
I installed Eclipse M6 and windowbuilderpro, then I created a new designer project and then a new swt application.

Just to show you the example I created:

import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class Pippo {

protected Shell shell;

public static void main(String[] args) {
try {
Pippo window = new Pippo();
window.open();
} catch (Exception e) {
e.printStackTrace();
}
}

public void open() {
final Display display = Display.getDefault();
createContents();
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}

protected void createContents() {
shell = new Shell();
shell.setSize(500, 375);
shell.setText("SWT Application");
}

}

When I try to run.........

error....

Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-win32-3128 in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:123)
at org.eclipse.swt.internal.win32.OS.<clinit>(OS.java:18)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:125)
at Pippo.open(Pippo.java:18)
at Pippo.main(Pippo.java:11)


After the new installation of eclipse I saw that there isn't the directory org.eclipse.swt.win32 and the org.eclipse.swt in the plugins dir.

Ciao
Antonio
pongs
 
Posts: 1
Joined: Sat Apr 09, 2005 8:47 am

Re: New Methodology

Postby Eric Clayberg » Sat Apr 09, 2005 12:26 pm

jleotta wrote:Yes I put the dll's (all three) in the system32 directory as I have always done and they are not found. I posted to the bulletin board the problem as well as have the users and no response all day.

That is very odd. When I do that, I am able to launch SWT apps just fine. Note that I am using Run As > Java Application rather than Run As > SWT Application (which is broken).

jleotta wrote:It seems they went to a new methodology for loading jars and dll's and unless its a secret no one seemed to run any tests.

Yes, they clearly screwed this up badly.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: M6 - swt problems

Postby Eric Clayberg » Sat Apr 09, 2005 12:29 pm

pongs wrote:After the new installation of eclipse I saw that there isn't the directory org.eclipse.swt.win32 and the org.eclipse.swt in the plugins dir.

Under M6, you need to extract the three DLLs from the new org.eclipse.swt.win32_3.1.0.jar file and copy them to your windows/system32 directory.

You should then be able to use Run As > Java Application to run them.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Works just fine now.

Postby jleotta » Sat Apr 09, 2005 12:50 pm

Thanks Eric. All works fine running app as Java instead of SWT. I'll post this on the bulleting board and make many happy.
jleotta
 
Posts: 31
Joined: Tue Aug 03, 2004 9:46 am

Re: M6 - swt problems

Postby bweith » Wed Apr 27, 2005 8:33 pm

pongs wrote:After the new installation of eclipse I saw that there isn't the directory org.eclipse.swt.win32 and the org.eclipse.swt in the plugins dir.

I have the same problem with M6 on Linux.

Eric Clayberg wrote:Under M6, you need to extract the three DLLs from the new org.eclipse.swt.win32_3.1.0.jar file and copy them to your windows/system32 directory.

You should then be able to use Run As > Java Application to run them.

Eric, how does one fix this on Linux-gtk?
bweith
 
Posts: 6
Joined: Wed Apr 27, 2005 8:25 pm

Re: M6 - swt problems

Postby Eric Clayberg » Thu Apr 28, 2005 4:04 am

bweith wrote:how does one fix this on Linux-gtk?

I imagine a similar procedure is required for Linux.

Extract the .so files from the jar and copy them to your path somewhere.

If that does not work, you should ask this question on the Eclipse SWT newsgroup.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Another couple of solutions

Postby jnlsbur » Mon May 02, 2005 12:30 pm

There are a couple of other ways to solve this also:

Option 1
Go to the RUN dialog and create an entry for your SWT application. On the "Arguments" tab add the following to the VM Arguments text area:
-java.library.path=[path to SWT DLL's]

Code: Select all
-java.library.path=c:\dev\swt


[Option 2]
Sun mentions that you add these files in to the SDK. The benefit of this option is that JAVA will locate the files properly without specifying them on your command lines.

On Windows:
    copy the swt*.DLL files from the SWT download in %JAVA_HOME%/jre/bin directory;

    copy the swt.jar file from the SWT download in %JAVA_HOME%/jre/lib/ext directory; (note: you may have to create the 'ext' directory manually).
jnlsbur
 
Posts: 2
Joined: Wed Apr 20, 2005 8:03 am
Location: Michigan


Return to SWT Designer

Who is online

Users browsing this forum: No registered users and 1 guest