Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] desperate : NoClassDefFoundError on Composite


Have you tested to add a Class path line in theMANIFEST.MF file contained into you jar ?
this could be close to:
Class-Path: swt.jar

But the Sun's documentation for manifest file, seems to said this work if swt.jar is located in the same
directory of your application.jar but not if it's inside application.jar ... a little test should confirm this.
(http://java.sun.com/docs/books/tutorial/jar/basics/manifest.html)

Arnaud.



"Johan Wasserman - BCX - Infrastructure Services" <Johan.Wasserman@xxxxxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx

10/29/2004 11:35 AM

Please respond to
platform-swt-dev

To
<platform-swt-dev@xxxxxxxxxxx>
cc
Subject
[platform-swt-dev] desperate : NoClassDefFoundError on Composite





I have eventually convinced my bosses that Java is the way to go, got a nice project, wrote it using SWT and everything's fine.... untill now:
 
I need to make the app "stand allone", in other words, not run from the Eclipse IDE.  So my classes are all in the default package (root) except for one or two utillity classes.  All my jars, including swt.jar, is in lib and all the required dll's also lies in the root of the project.
 
So, I jar'd the root of the project and now I'm trying to run the app from it.  So remember all the classes, jar's and dll's are contained whithin the new jar.
 
I get the following error when trying to run the app from the jar...
 
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Composite
       at java.lang.ClassLoader.defineClass0(Native Method)
       at java.lang.ClassLoader.defineClass(Unknown Source)
       at java.security.SecureClassLoader.defineClass(Unknown Source)
       at java.net.URLClassLoader.defineClass(Unknown Source)
       at java.net.URLClassLoader.access$100(Unknown Source)
       at java.net.URLClassLoader$1.run(Unknown Source)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(Unknown Source)
       at java.lang.ClassLoader.loadClass(Unknown Source)
       at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
       at java.lang.ClassLoader.loadClass(Unknown Source)
       at java.lang.ClassLoader.loadClassInternal(Unknown Source)

 
 
My main class extends org.eclipse.swt.widgets.Composite and I made the jar runnable (manifest entry).

Back to the top