can not find main (was swt and eclipse) [message #442494] |
Sat, 04 September 2004 14:38 |
Jeff Kish Messages: 5 Registered: July 2009 |
Junior Member |
|
|
I'm trying to run the swt sample.
I'm getting a error when
I try to activate the run configuration:
First a popup:
title: Java Virtual Machine Launcher
body: Could not find the main class. Program will exit.
then on the Console tab:
java.lang.NoClassDefFoundError: swt/win32_3/0/0/os//x86
exception in thread "main"
It seems obvious what the problem is, but as I used the "search" button when
putting together the run configuration to find the main class. I'm not sure
what I bolluxed up.
Thanks for any hints,
My program seems to build ok:
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
/*
* Created on Sep 1, 2004
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
/**
* @author jeff kish
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class HelloWorld {
public static void main(String[] args) {
Display display = new Display ();
Shell shell = new Shell (display);
Label label = new Label (shell, SWT.CENTER);
label.setText ("Hello_world");
label.setBounds (shell.getClientArea ());
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}
}
Jeff Kish
|
|
|
Powered by
FUDForum. Page generated in 0.03593 seconds