Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » creating executable jar
creating executable jar [message #465968] Tue, 27 December 2005 17:33 Go to next message
Aleksandr Kravets is currently offline Aleksandr KravetsFriend
Messages: 55
Registered: July 2009
Member
Hi,

I am trying to create an executable jar from my SWT project. In Eclipse
I exported the project and created the jar file. I also created
directory lib and put three jars in there:
org.eclipse.core.runtime_3.1.0.v20051027.jar, rg.eclipse.jface_3.2.0.jar
and swt.jar.

My MANIFEST.MF file looks like this:

Manifest-Version: 1.0
Main-Class: com.kwi.gui.WidgetWindow
Class-Path: ./lib/org.eclipse.core.runtime_3.1.0.v20051027
../lib/org.eclipse.jface_3.2.0 ./lib/swt.jar

------------------------------------------------------------ -------------------------------------------

and .classpath:


<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path=""/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry sourcepath="./lib/org.eclipse.jface_3.2.0.jar"
kind="lib" path="./lib/org.eclipse.jface_3.2.0.jar"/>
<classpathentry kind="lib"
path=./lib/org.eclipse.core.runtime_3.1.0.v20051027.jar"/>
<classpathentry kind="lib" path="./lib/org.eclipse.swt/swt.jar"/>
<classpathentry kind="output" path=""/>
</classpath>

However, if I double-click on application jar, I get error: "Could not
find the main class", but if I execute the jar on command line I get
different error:

Exception in thread "main" java.lang.NoClassDefFoundError:
org/eclipse/jface/window/ApplicationWindow

Which I guess means that it can't find external jars that I am including
where ApplicationWindow class lives.

And finally this is my folder structure:

clientSQL
|
------ com
|
------ lib
|
------ .classpath
|
------ .settings
|
------ .project
|
------ clientSQL.jar
|
------ MANIFEST.MF
|
------ swt-awt-win32-3139.dll
|
------ swt-win32-3139.dll

Also, one more dumb question. If I describe all my jar dependencies in
MANIFEST.MF file, what's the function of .classpath file?

Any help is greatly appreciated.

thanks!
Alex
Re: creating executable jar [message #465977 is a reply to message #465968] Tue, 27 December 2005 23:44 Go to previous message
Aleksandr Kravets is currently offline Aleksandr KravetsFriend
Messages: 55
Registered: July 2009
Member
Ah...found good documentation for this:
http://www.zikal.com/jface/JFace3_1.html

thanks Bill!

Aleksandr Kravets wrote:
> Hi,
>
> I am trying to create an executable jar from my SWT project. In Eclipse
> I exported the project and created the jar file. I also created
> directory lib and put three jars in there:
> org.eclipse.core.runtime_3.1.0.v20051027.jar, rg.eclipse.jface_3.2.0.jar
> and swt.jar.
>
> My MANIFEST.MF file looks like this:
>
> Manifest-Version: 1.0
> Main-Class: com.kwi.gui.WidgetWindow
> Class-Path: ./lib/org.eclipse.core.runtime_3.1.0.v20051027
> ./lib/org.eclipse.jface_3.2.0 ./lib/swt.jar
>
> ------------------------------------------------------------ -------------------------------------------
>
>
> and .classpath:
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <classpath>
> <classpathentry kind="src" path=""/>
> <classpathentry kind="con"
> path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
> <classpathentry sourcepath="./lib/org.eclipse.jface_3.2.0.jar"
> kind="lib" path="./lib/org.eclipse.jface_3.2.0.jar"/>
> <classpathentry kind="lib"
> path=./lib/org.eclipse.core.runtime_3.1.0.v20051027.jar"/>
> <classpathentry kind="lib" path="./lib/org.eclipse.swt/swt.jar"/>
> <classpathentry kind="output" path=""/>
> </classpath>
>
> However, if I double-click on application jar, I get error: "Could not
> find the main class", but if I execute the jar on command line I get
> different error:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/eclipse/jface/window/ApplicationWindow
>
> Which I guess means that it can't find external jars that I am including
> where ApplicationWindow class lives.
>
> And finally this is my folder structure:
>
> clientSQL
> |
> ------ com
> |
> ------ lib
> |
> ------ .classpath
> |
> ------ .settings
> |
> ------ .project
> |
> ------ clientSQL.jar
> |
> ------ MANIFEST.MF
> |
> ------ swt-awt-win32-3139.dll
> |
> ------ swt-win32-3139.dll
>
> Also, one more dumb question. If I describe all my jar dependencies in
> MANIFEST.MF file, what's the function of .classpath file?
>
> Any help is greatly appreciated.
>
> thanks!
> Alex
>
>
>
Previous Topic:Adding a widget in runtime
Next Topic:HowTo subclass/extend/customize Item to have multiple active Widgets?
Goto Forum:
  


Current Time: Tue Sep 24 23:06:23 GMT 2024

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

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

Back to the top