views:

23

answers:

1

So I'm working on a java project (an exitsing java project that uses maven2, not mine). Everything works fine. I add a new class to the source directory.

I do mvn compile and get success. I then do `mvn exec:java -Dexec.mainClass="package.NewClass"

and get classNotFoundException.

It does compile the new file, and I can see the NewClass.class in the right directory with the other classes. So I don't get the classNotFoundException. Do I need to make any changes to the pom.xml?

Thanks!!

A: 

Try

mvn exec:java -Dexec.mainClass="package.NewClass"

Resources :

Colin Hebert
This is what I'm doing. Will update my question.