Today, when I was typing the jar package, I stepped on the pit at runtime:
There is no problem with packaging and running in idea, but an error is reported when running java -jar:
Most of the methods found on the Internet are to specify the main class.
I have already specified it but still report an error. There is still a way to say not to specify the mainClass, or useless.
In fact, it should be added again and
packaged again:
it was found that the version of maven was not specified,
and it succeeded after adding: