creating executable jar [message #465968] |
Tue, 27 December 2005 12:33  |
Eclipse User |
|
|
|
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 18:44  |
Eclipse User |
|
|
|
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
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.33995 seconds