Silk13 Silk13 - 1 year ago 62
Java Question

Program runs fine in Eclipse, but throws error when Jar is run on the command line

Compiled with

mvn package
, I then try to run the
with java
-jar app.jar
and it runs, but then throws a


The program runs completely fine in Eclipse.

How do I stop this from happening so I can run the program in the command line?

Answer Source

Looks like you are missing dependencies. Try putting this in your pom.xml:


And then run: java -jar [your-package-jar-with-dependencies.jar]

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download