I have a problem when I run my Java application for a FIX application. I have added all the QuickFIX/J jars to build the FIX application. But when I run my jar I always get this error:

Application: TestMarketdataRequest 
Exception in thread "main" java.lang.NoClassDefFoundError: quickfix/MessageStoreFactory
    at com.dxtr.fastmatch.FastmatchMDRequest.<init>(FastmatchMDRequest.java:14)
    at com.dxtr.fastmatch.FastmatchMDRequest.main(FastmatchMDRequest.java:19)
Caused by: java.lang.ClassNotFoundException: quickfix.MessageStoreFactory
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    ... 2 more

My question: How do I fix this and why do I get this error when I did add QuickFIX/J in my depedencies?

Include the dependency jar in your classpath when you run the main class using the -cp option:

java -cp quickfixj.jar MainClass

-classpath classpath
-cp classpath
Specifies a list of directories, JAR files, and ZIP archives to search for class files. Separate class path entries with semicolons (;). Specifying -classpath or -cp overrides any setting of the CLASSPATH environment variable.

More on the docs.


this is closed. i have add executable jar in my pom. so it is closed right now thanks all