[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.newcomer] Re: Howto export swt to jar
|
- From: Canned <user@xxxxxxxxxxxxxx>
- Date: Sun, 29 Jul 2007 02:43:56 +0200
- Newsgroups: eclipse.newcomer
- Organization: EclipseCorner
- User-agent: Thunderbird 1.5.0.12 (X11/20060911)
Paul A. Rubin schreef:
> 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?
>
I've already copied swt.jar to the same directory as program.jar and I
don't know if I need any dll to execute my program. I've added
org.eclipse.swt to my build path, added swt.jar to libraries, and in
order and export all items are checked (swt.jar, jre system library,
org.eclipse.swt) but still don't work.
> 2. If you execute java -cp "swt.jar;." -jar program.jar, does that work?
>
Still give me the same error.
> 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.)
>
Yes.
Manifest-Version: 1.0
Main-Class: editor.editor
Classpath: swt.jar
> /Paul
Here is what I've done so far. I'm trying to make a simple text editor,
like the one from eclipse example. I've downloaded
swt-3.2.2-gtk-linux-x86.zip and import it to eclipse. Then I create a
new java project, adding org.eclipse.swt to build path