0

I have a complex Java app using 5 or 6 Maven artifacts, plus my own code. I have downloaded their jar files and am referencing them explicitly in the -classpath parameter of a java command.

The main line specified in the java command does exist, and I can run it under Eclipse.

However, when I try to run the java command, I get the message Error: Could not find or load main class. I understand that this is probably due to a class that it can't find somewhere in the application.

My question is simply whether there is a way to zero in on the class or classes that are missing or misspelled! I tried -verbose, but this doesn't show any of my code... I did prefix my -classpath with the .; so it should at least have been able to see my code!

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Paul Morrison
  • 1,694
  • 3
  • 20
  • 35
  • Are you using the fully qualified name of your class, that is, the package name followed by a period followed by the name of the class? I think it will help if you show the command you’re trying to execute. – VGR Nov 04 '20 at 03:23
  • How exactly are you launching your application, can you show the full command. This existing answer has some great suggestions on how to track down what might have caused the error: https://stackoverflow.com/a/18093929/1270000 – sorifiend Nov 04 '20 at 03:47

0 Answers0