Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT JAR packaging
SWT JAR packaging [message #443947] Tue, 05 October 2004 00:01 Go to next message
Eclipse UserFriend
Originally posted by: abonorio.ncsu.edu

Hi newsgroup,

I have a question about packing an SWT application in a JAR. I keep getting
odd errors when trying to execute the application, namely, "Could not find
the main class. The program will exit."

Any advice. I have a feeling it has something to do with the classpath
variables...

Thanks,

Brian
Re: SWT JAR packaging [message #443978 is a reply to message #443947] Tue, 05 October 2004 09:07 Go to previous message
Andreas Niemeyer is currently offline Andreas NiemeyerFriend
Messages: 40
Registered: July 2009
Member
Brian Onorio wrote:

> Hi newsgroup,
>
> I have a question about packing an SWT application in a JAR. I keep getting
> odd errors when trying to execute the application, namely, "Could not find
> the main class. The program will exit."
>
> Any advice. I have a feeling it has something to do with the classpath
> variables...
>
> Thanks,
>
> Brian
>
>

You have to create a Manifest file, e.g.

Manifest-Version: 1.0
Class-Path: . lib/swt-3.0M9-hpux-motif/swt.jar
lib/swt-3.0M9-hpux-motif/swt-mozilla.jar
lib/swt-3.0M9-hpux-motif/swt-gtk.jar
lib/org.eclipse.jface_3.0.0/jface.jar
lib/org.eclipse.core.runtime_3.0.0/runtime.jar
lib/ext/javamail-1.3.1/mail.jar lib/ext/oracle-jdbc-12/classes12.jar
Main-Class: packageA.progs.ProgName

In the classpath there is a relative lib path with subfolders, which
contains the required libs (for me in this example)

Then you generate your jar by pick up your packages/classes you want to
archive:

jar -cmfv META-INF/MANIFEST.MF ProgPackage.jar packageA packageB



Good luck!

Regards,
Andreas
Previous Topic:avoid key-events to be processed by TableCursor
Next Topic:Launch program and pass parameters to it
Goto Forum:
  


Current Time: Fri Mar 29 11:58:35 GMT 2024

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

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

Back to the top