Shailesh, To make a jar file executable, you need to set the Main-Class attribute in the manifest, see:
http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Main% 20Attributes To have Maven 1.0.2 set the Main-Class attribute in the manifest for you, it looks like you can set the maven.jar.mainclass property to the fully-qualified name of your class that has a main() method (example: mdn.testapp.App). Details here: http://maven.apache.org/maven-1.x/reference/plugins/jar/properties.html For example, put this in your project.properties file maven.jar.mainclass=mdn.testapp.App And then rebuild the jar: maven clean jar To run your executable jar file, type something like this: java -jar target\test-application-1.0.jar Hope that helps, -Max On Tue, 2006-01-17 at 13:52 +0000, narayan dhumale wrote: > Hello, > I have installed the maven 1.0.2 on my PC after which proper environmental > variables also set. > I am trying to compile the java clasas in my template(a sample > application).Also try to create the junit testcases & compile them. > All these things are happening properly by executing build by following > command -->C:test\a\b:>maven jar. > After this if i try to execute the JAR file(say test-application.1.0.jar)by > giving command -->C:test\a\b:>maven ^ > ? test-application-1.0.jar mdn.testapp.App ,i am getting Exception in Thread > "main" java.lang.NoclassDefFoundError. > > Why its happening? > > The class contains the simple S.O.P of HELLO WORLD! > > Can anybody help me please???? > > > Regards, > Shailesh --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
