java.lang.NoClassDefFoundError

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

java.lang.NoClassDefFoundError

Postby cebarne2 » Tue Nov 11, 2003 7:50 am

Hey all,

Trying to run a jar file I exported after using the New SWT Application wizard. I've tried all manner of classpaths, but still get the error. I even now have all the JAR files in the same directory, even the dll, and still the following error.

Any help?

java -jar swtcalc.jar -classpath .
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Composite

The directory contents:
boot.jar
runtime.jar
jface.jar
swt.jar
swtcalc.jar
swt-win32-2135.dll

I've even tried this command:

java -jar swtcalc.jar -classpath "c:\program files\eclipse\plugins\org.e
clipse.core.boot_2.1.1\";"c:\program files\eclipse\plugins\org.eclipse.core.runtime_2.1.1\";"c:\program files\eclipse\plugins\org.eclipse.jface_2.1.1\";"c:\program files\eclipse\plugins\org.eclipse.swt.win32_2.1.1\ws\win32\" -Djava.library.path="C:\Program Files\eclipse\plugins\org.eclipse.swt.win32_2.1.1\os\win32\x86\"

Thanks,

Chad
cebarne2
 
Posts: 67
Joined: Tue Sep 23, 2003 10:11 am
Location: Cedar Rapids, IA

Postby cebarne2 » Tue Nov 11, 2003 8:26 am

Works:
java -cp .;"c:\program files\eclipse\plugins\org.eclipse.swt.win32_2.1.1\ws\win32\swt.jar" CalcMain

Doesn't:
java -jar swtcalc.jar -cp .;"c:\program files\eclipse\plugins\org.eclipse.swt.win32_2.1.1\ws\win32\swt.jar" CalcMain
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Composite

Hmmm, something wrong with my .jar file? It worked after I extracted the .jar file (jar -xf swtcalc.jar).

-Chad
cebarne2
 
Posts: 67
Joined: Tue Sep 23, 2003 10:11 am
Location: Cedar Rapids, IA

Postby admin » Tue Nov 11, 2003 9:54 pm

As far as I know, when you use -jar, Java does not uses -classpath values, it looks in jar manifest for classpath.
admin
Moderator
 
Posts: 166
Joined: Thu Jul 24, 2003 12:25 am

Postby cebarne2 » Wed Nov 12, 2003 5:46 am

Well, there's something basic I didn't know. Thanks.
cebarne2
 
Posts: 67
Joined: Tue Sep 23, 2003 10:11 am
Location: Cedar Rapids, IA


Return to SWT Designer

Who is online

Users browsing this forum: Google [Bot] and 1 guest