[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.newcomer] Re: Howto export swt to jar

Canned wrote:
Hi,
I'm not very familiar with swt and eclipse. I made a simple program
which only show a window with a menu bar on it using swt. I can run it
with eclipse but when I tried to export it to jar and execute it with
"java -jar program.jar" I get "Exception in thread "main"
java.lang.NoClassDefFoundError:
org/eclipse/swt/events/SelectionListener". I've edited the manifest.mf
file and add "Classpath: swt.jar" on it but the error still there. (I
folowed this instruction on the net with no luck:
http://blog.redditech.com/professional/solution-to-problem-running-swt-app-from-jar/)

Any idea what I'm missing here?

1. Do you have swt.jar and the required swt.whatever.dll in the directory in which you're trying to run program.jar?


2.  If you execute java -cp "swt.jar;." -jar program.jar, does that work?

3. Have you checked to make sure the manifest file in program.jar really contains the classpath info? (You can open program.jar using your favorite zip utility, then open manifest.mf in a text editor and check it.)

/Paul