Re: jar file won't run
Mark Space wrote:
michau wrote:
I'm not an expert but, does it mean that I should have input a line
declaring a main class for the .jar file somewhere in some manifest
file?
Karl posted a good link for manifest files, and Nigel also brought up a
good point. NetBeas won't create a main class if you are building a
library, as opposed to an application.
It's not the main class that's the real problem, you can always add that
yourself and set it in the project properties. If the project isn't a Java
Application the ant script which NetBeans auto generates doesn't create the
dist/lib directory and copy the dependent jars into it, nor does it create a
manifest pointing to the dependent jars. That means that the project jar can't
be run directly outside of NetBeans. It requires a classpath to tell it where
to locate the jars it needs.
--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555