0

We have the below java command which was running and stopped working all of a sudden,

java –cp "classes:lib/*" xxx.yyy.ppp

The jar is within lib directory and the jar contains the class. It stopped working all of a sudden and gived the below error,

"Error: Could not find or load main class –cp"

Why is it considering '-cp' as the main class, even though ppp (example) has the main class. Please help me out with this...

Sijo Kurien
  • 95
  • 2
  • 10

1 Answers1

1

You are not using a default hypen before cp as java –cp "classes:lib/*" xxx.yyy.ppp

Use this instead : java -cp "classes:lib/*" xxx.yyy.ppp

Som
  • 1,522
  • 1
  • 15
  • 48
  • True, i copied the comand which the team was using. Thanks. But how on earth that hyphen can come? – Sijo Kurien Aug 25 '20 at 14:56
  • 2
    @SijoKurien I suspect someone pasted the command into a word processor, which “helpfully” turned the ASCII hyphen into a dash, and then you copied it from that word processing document. – VGR Aug 25 '20 at 14:58
  • 1
    It may be some kind of special formatted character. I am not sure, may be while copying it got converted to that. From where did you copy ? Internet or some files ? – Som Aug 25 '20 at 14:59
  • yes, my team member copied from a word document – Sijo Kurien Aug 25 '20 at 15:04