If it's really a standalone app, you can also use the maven-shade-plugin [1] 
for creating an 'uber-jar' which contains all the dependencies.

LieGrue,
strub

[1] http://maven.apache.org/plugins/maven-shade-plugin/

--- On Tue, 10/13/09, Entner Harald <[email protected]> wrote:

> From: Entner Harald <[email protected]>
> Subject: AW: AW: Running Jar file created by Maven
> To: "Maven Users List" <[email protected]>
> Date: Tuesday, October 13, 2009, 11:50 AM
> How do you run the jar file? (outside
> netbeans). 
> 
> with java -jar .... ? 
> 
> If you do so, the jar files need to be included in the
> resulting jar file, or you have to add it to the classpath,
> via -cp ...
> 
> -----Ursprüngliche Nachricht-----
> Von: jamborta [mailto:[email protected]]
> 
> Gesendet: Dienstag, 13. Oktober 2009 11:38
> An: [email protected]
> Betreff: Re: AW: Running Jar file created by Maven
> 
> 
> it's a pure java project. and it runs OK inside netbeans. I
> get a
> NoClassDefFoundError if try to run it from the command
> line:
> 
> Exception in thread "main" java.lang.NoClassDefFoundError:
> cern/colt/function/In
> tObjectProcedure
>         at
> com.main.App.main(App.java:36)
> Caused by: java.lang.ClassNotFoundException:
> cern.colt.function.IntObjectProcedu
> re
>         at
> java.net.URLClassLoader$1.run(Unknown Source)
>         at
> java.security.AccessController.doPrivileged(Native Method)
>         at
> java.net.URLClassLoader.findClass(Unknown Source)
>         at
> java.lang.ClassLoader.loadClass(Unknown Source)
>         at
> sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>         at
> java.lang.ClassLoader.loadClass(Unknown Source)
>         at
> java.lang.ClassLoader.loadClassInternal(Unknown Source)
>         ... 1 more
> 
> 
> 
> What kind of project are you talking about? Is it a pure
> Java project or
> does it run inside glassfish (for example)? What class
> files are missing?
> How does the stacktrace look like? 
> 
> Try to add the missing artifacts to the pom.
> 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/Running-Jar-file-created-by-Maven-tp25869690p25869863.html
> Sent from the Maven - Users mailing list archive at
> Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to