Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Exception : ..... org/eclipse/swt/internal/gtk/GdkEvent ....
Exception : ..... org/eclipse/swt/internal/gtk/GdkEvent .... [message #436309] Sun, 16 May 2004 15:17 Go to next message
Eclipse UserFriend
Originally posted by: jumamurat.web.de

Hello everyone!
This is "helloworld" program but i couldn't even run this :(!
so here is the code:
***************************************************
package swt;

import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;

public class SWTHello {

public static void main(String[] args) {
try{
24(line number) Display display = new Display();
25 Shell shell = new Shell(display);
26 Label label = new Label(shell, SWT.NONE);
label.setText("Hello World!");
shell.pack();
label.pack();
shell.open();
while(!shell.isDisposed()){
if(!display.readAndDispatch()){
display.sleep();
}
}
display.dispose();
label.dispose();
} catch(Exception e){
System.out.println("Error!");
e.printStackTrace();
}
}
}

******************************************************

i added swt.jar to the project
and as in the tutorial i run program with vm arguments
-Djava.library.path=$HOME/tools/eclipseGTK2.1/plugins/org.ec lipse.swt.gtk._2.1.2/os/linux/x86/


but then i've got a strange error :

Exception in thread "main" java.lang.NoClassDefFoundError:
org/eclipse/swt/internal/gtk/GdkEvent
at swt.SWTHello.main(SWTHello.java:24)

line 24 is Display display = new Display();



what can be wrong? Any idea?

Thank you for your help!
Regards, J.B.
Re: Exception : ..... org/eclipse/swt/internal/gtk/GdkEvent .... [message #436311 is a reply to message #436309] Mon, 17 May 2004 04:04 Go to previous messageGo to next message
Silenio Quarti is currently offline Silenio QuartiFriend
Messages: 31
Registered: July 2009
Member
The GTK port of SWT has two jars: swt.jar & swt-pi.jar. Both jars need to
be in the classpath.

Silenio

Jumamurat Bayjanov wrote:

> Hello everyone!
> This is "helloworld" program but i couldn't even run this :(!
> so here is the code:
> ***************************************************
> package swt;

> import org.eclipse.swt.*;
> import org.eclipse.swt.widgets.*;

> public class SWTHello {

> public static void main(String[] args) {
> try{
> 24(line number) Display display = new Display();
> 25 Shell shell = new Shell(display);
> 26 Label label = new Label(shell, SWT.NONE);
> label.setText("Hello World!");
> shell.pack();
> label.pack();
> shell.open();
> while(!shell.isDisposed()){
> if(!display.readAndDispatch()){
> display.sleep();
> }
> }
> display.dispose();
> label.dispose();
> } catch(Exception e){
> System.out.println("Error!");
> e.printStackTrace();
> }
> }
> }

> ******************************************************

> i added swt.jar to the project
> and as in the tutorial i run program with vm arguments
>
-Djava.library.path=$HOME/tools/eclipseGTK2.1/plugins/org.ec lipse.swt.gtk._2.1.2/os/linux/x86/


> but then i've got a strange error :

> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/eclipse/swt/internal/gtk/GdkEvent
> at swt.SWTHello.main(SWTHello.java:24)

> line 24 is Display display = new Display();



> what can be wrong? Any idea?

> Thank you for your help!
> Regards, J.B.
Re: Exception : ..... org/eclipse/swt/internal/gtk/GdkEvent .... [message #436574 is a reply to message #436311] Wed, 19 May 2004 16:25 Go to previous message
Eclipse UserFriend
Originally posted by: jumamurat.web.de

Hello Silenio!
Thank you for your help!
It solved one problem but still there is a problem!

I run it as following

java swt.SWTHello -cp
../../../../../eclipseGTK2.1/plugins/org.eclipse.swt.gtk_2.1 .2/ws/gtk/swt.jar:./../../../../eclipseGTK2.1/plugins/org.ec lipse.swt.gtk_2.1.2/ws/gtk/swt-pi.jar
-Djava.library.path=./../../../../eclipseGTK2.1/plugins/org. eclipse.swt.gtk_2.1.2/os/linux/x86

but now error is different:

Exception in thread "main" java.lang.NoClassDefFoundError:
org/eclipse/swt/widgets/Composite
Regards, J.B!

Silenio Quarti wrote:
> The GTK port of SWT has two jars: swt.jar & swt-pi.jar. Both jars need to
> be in the classpath.
>
> Silenio
>
> Jumamurat Bayjanov wrote:
>
>
>>Hello everyone!
>>This is "helloworld" program but i couldn't even run this :(!
>>so here is the code:
>>***************************************************
>>package swt;
>
>
>>import org.eclipse.swt.*;
>>import org.eclipse.swt.widgets.*;
>
>
>>public class SWTHello {
>
>
>> public static void main(String[] args) {
>> try{
>>24(line number) Display display = new Display();
>>25 Shell shell = new Shell(display);
>>26 Label label = new Label(shell, SWT.NONE);
>> label.setText("Hello World!");
>> shell.pack();
>> label.pack();
>> shell.open();
>> while(!shell.isDisposed()){
>> if(!display.readAndDispatch()){
>> display.sleep();
>> }
>> }
>> display.dispose();
>> label.dispose();
>> } catch(Exception e){
>> System.out.println("Error!");
>> e.printStackTrace();
>> }
>> }
>>}
>
>
>>******************************************************
>
>
>>i added swt.jar to the project
>>and as in the tutorial i run program with vm arguments
>>
>
> -Djava.library.path=$HOME/tools/eclipseGTK2.1/plugins/org.ec lipse.swt.gtk._2.1.2/os/linux/x86/
>
>
>
>>but then i've got a strange error :
>
>
>>Exception in thread "main" java.lang.NoClassDefFoundError:
>>org/eclipse/swt/internal/gtk/GdkEvent
>> at swt.SWTHello.main(SWTHello.java:24)
>
>
>>line 24 is Display display = new Display();
>
>
>
>
>>what can be wrong? Any idea?
>
>
>>Thank you for your help!
>>Regards, J.B.
>
>
>
Previous Topic:SWT_AWT still experimental?
Next Topic:problems displaying a treeitem
Goto Forum:
  


Current Time: Fri Apr 26 14:42:39 GMT 2024

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

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

Back to the top