How to use java command to Run .jar

Environment:

  1. Maven
  2. Junit
  3. Java
  4. Appium

Scenario:

  1. Followed document from Amazon and created "with-dependencies.jar" file.
  2. The sample command I have been tried but not working:
    java -cp with-dependencies.jar com.mycompany.app.Tests

The error is: “Error: Could not find or load main class com.mycompany.app.Tests”

PS:upload to Device Farm without any issues. Just need to get help how to run it on my local computer please