maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TenLeftFingers <>
Subject Sonatype tutorial has an error? I can't execute the basic jar.
Date Tue, 13 Aug 2013 10:01:24 GMT
>From the sonatype introduction to Maven
I've built a project following the instructions exactly. When I issue the

   java -cp target/simple-1.0-SNAPSHOT.jar org.sonatype.mavenbook.App 

I get the error: 

   Exception in thread "main" java.lang.NoClassDefFoundError:
   Caused by: java.lang.ClassNotFoundException: org.sonatype.mavenbook.App  
        at Method)  
        at java.lang.ClassLoader.loadClass(  
        at sun.misc.Launcher$AppClassLoader.loadClass(  
        at java.lang.ClassLoader.loadClass(  
    Could not find the main class: org.sonatype.mavenbook.App.  Program will

The project was created successfully:
   mvn archetype:generate -DgroupId=org.sonatype.mavenbook.simple \  
   -DartifactId=simple \  
   -Dpackage=org.sonatype.mavenbook \  

and built:
  $cd simple
  $mvn install

What can be wrong with my java command that causes this exception?
(the .java file is present as is the .jar) so what can be the problem with
the java command?

View this message in context:
Sent from the Maven - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message