• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How do I run my SWT app outside Eclipse?

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Greetings!

I've developed an application in Eclipse using SWT. It runs fine in Eclipse by using Run->Run as->Java Application.

When I try to run the application outside of Eclipse, I use the -Djava_library_path to point to the SWT libs, but I always receive this error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Composite

I get the same when I try to package it in a jar; I'm not even sure how to package up an SWT app in a jar. I fairly new to Eclipse and SWT so any suggestions are welcome.

Regards,
Nigel
 
author
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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


You need to make sure that the swt.jar file is included on your classpath. The swt.jar is in the <eclipse>\plugins\org.eclipse.swt.win32_3.0.0\ws\win32 directory. You also need to make sure that the SWT DLL (e.g., swt-win32-3062.dll) is on your path. The SWT DLL is in the <eclipse>\plugins\org.eclipse.swt.win32_3.0.0\os\win32\x86 directory.
 
Nigel Skeffington
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Eric. BTW, your SWT Designer looks really nice. I'm going to check out the trial.

-Nigel
 
Too many men are afraid of being fools - Henry Ford. Foolish tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic