Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Unable to run "Snippet1" from the swt website
Unable to run "Snippet1" from the swt website [message #447903] Tue, 21 December 2004 17:34 Go to next message
Philip A. Chapman is currently offline Philip A. ChapmanFriend
Messages: 3
Registered: July 2009
Junior Member
Everyone,

I'm not used to asking newbie type questions, but this one has me stumped.
I am trying to learn SWT (hopefully to use it in conjunction with gcj in
the near future). I first tried to run the first example in an online
tutorial and came up with errors. I then tried Snippet1 from the swt
website and got the same errors. Originally, I set CLASSPATH to
include $ECLIPSE_HOME/plugins/org.eclipse.swt.gtk_3.0.1/ws/gtk/swt.j ar
and LD_LIBRARY_PATH to include
$ECLIPSE_HOME/plugins/org.eclise.swt.gtk_3.0.1/os/linux/x86. I then
downloaded swt by itself, versions 3.1 M3 and 3.0.1 (both for linux
and gtk). I get the same errors with each try:

Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/internal/gtk/OS
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java: 63)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java: 54)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:118)
at Snippet1.main(Snippet1.java:23)

Expanding the swtsrc.zip file, I see no org.eclipse.swt.internal.gtk
package, much less an org.eclipse.swt.internal.gtk.OS class. I am at a
loss. If anyone could kindly point me in the right direction, I would be
thankful.

Thanks,
--
Philip A. Chapman

Application Development:
Java, Visual Basic (MCP), PostgreSQL, MySQL, MSSQL
Linux, Windows 9x, Windows NT, Windows 2000, Windows XP
Re: Unable to run "Snippet1" from the swt website [message #447962 is a reply to message #447903] Wed, 22 December 2004 14:35 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi Philip,

You need to add the swt-pi.jar to your CLASSPATH as well.

Grant

"Philip A. Chapman" <pchapman@pcsw.us> wrote in message
news:pan.2004.12.21.17.30.36.83231@pcsw.us...
> Everyone,
>
> I'm not used to asking newbie type questions, but this one has me stumped.
> I am trying to learn SWT (hopefully to use it in conjunction with gcj in
> the near future). I first tried to run the first example in an online
> tutorial and came up with errors. I then tried Snippet1 from the swt
> website and got the same errors. Originally, I set CLASSPATH to
> include $ECLIPSE_HOME/plugins/org.eclipse.swt.gtk_3.0.1/ws/gtk/swt.j ar
> and LD_LIBRARY_PATH to include
> $ECLIPSE_HOME/plugins/org.eclise.swt.gtk_3.0.1/os/linux/x86. I then
> downloaded swt by itself, versions 3.1 M3 and 3.0.1 (both for linux
> and gtk). I get the same errors with each try:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
org/eclipse/swt/internal/gtk/OS
> at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java: 63)
> at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java: 54)
> at org.eclipse.swt.widgets.Display.<clinit>(Display.java:118)
> at Snippet1.main(Snippet1.java:23)
>
> Expanding the swtsrc.zip file, I see no org.eclipse.swt.internal.gtk
> package, much less an org.eclipse.swt.internal.gtk.OS class. I am at a
> loss. If anyone could kindly point me in the right direction, I would be
> thankful.
>
> Thanks,
> --
> Philip A. Chapman
>
> Application Development:
> Java, Visual Basic (MCP), PostgreSQL, MySQL, MSSQL
> Linux, Windows 9x, Windows NT, Windows 2000, Windows XP
>
Re: Unable to run "Snippet1" from the swt website [message #447986 is a reply to message #447903] Wed, 22 December 2004 15:03 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
On some platforms there are multiple jars for SWT. For GTK in 3.0.1, there
are the following jars:

swt.jar
swt-pi.jar
swt-mozilla.jar (only required if you are using the Browser widget)

You must include all of these jars on your classpath

"Philip A. Chapman" <pchapman@pcsw.us> wrote in message
news:pan.2004.12.21.17.30.36.83231@pcsw.us...
> Everyone,
>
> I'm not used to asking newbie type questions, but this one has me stumped.
> I am trying to learn SWT (hopefully to use it in conjunction with gcj in
> the near future). I first tried to run the first example in an online
> tutorial and came up with errors. I then tried Snippet1 from the swt
> website and got the same errors. Originally, I set CLASSPATH to
> include $ECLIPSE_HOME/plugins/org.eclipse.swt.gtk_3.0.1/ws/gtk/swt.j ar
> and LD_LIBRARY_PATH to include
> $ECLIPSE_HOME/plugins/org.eclise.swt.gtk_3.0.1/os/linux/x86. I then
> downloaded swt by itself, versions 3.1 M3 and 3.0.1 (both for linux
> and gtk). I get the same errors with each try:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/eclipse/swt/internal/gtk/OS
> at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java: 63)
> at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java: 54)
> at org.eclipse.swt.widgets.Display.<clinit>(Display.java:118)
> at Snippet1.main(Snippet1.java:23)
>
> Expanding the swtsrc.zip file, I see no org.eclipse.swt.internal.gtk
> package, much less an org.eclipse.swt.internal.gtk.OS class. I am at a
> loss. If anyone could kindly point me in the right direction, I would be
> thankful.
>
> Thanks,
> --
> Philip A. Chapman
>
> Application Development:
> Java, Visual Basic (MCP), PostgreSQL, MySQL, MSSQL
> Linux, Windows 9x, Windows NT, Windows 2000, Windows XP
>
Previous Topic:Is there any library for common "OPEN", "SAVE" icon?
Next Topic:ScrolledPageBook example
Goto Forum:
  


Current Time: Thu Apr 25 21:45:15 GMT 2024

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

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

Back to the top