Exception : ..... org/eclipse/swt/internal/gtk/GdkEvent .... [message #436309] |
Sun, 16 May 2004 15:17 |
Eclipse User |
|
|
|
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 #436574 is a reply to message #436311] |
Wed, 19 May 2004 16:25 |
Eclipse User |
|
|
|
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.
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04423 seconds