<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.8</version>
</dependency>
</dependencies>
For some reason whenever I try to run my maven project I get this error
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/csv/CSVFormat.
But I checked my classpath, it's correct. I've checked my dependencies, they're correct.
I think it might be the command that is leading to the exception. How do you run a Maven project with an external jar in the classpath?
java -cp target/classes packageName
Is that correct?