Hi everyone,
I've created a
Maven Project in Eclipse to copy files from one location to another using the org.apache.commons.io.FileUtils class from Apache Commons IO. The code runs fine and successfully copies files when run in Eclipse and when I run the project as a Maven package configuration it successfully downloads the dependencies I've specified in my pom.xml file to the target directory as well as creating the JAR file. When I try and run the JAR from the command prompt I get the following error:
Exception in
thread "main" java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils
at com.statestreet.common.App.main(App.java:26)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.FileUtils
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)
... 1 more
This is despite the fact that I've specified Apache Commons IO as a dependency. Can someone please assist? Here is my code and pom for reference