On the main method in Java execution jar package
After the jar file is packaged through Onejar or Maven, use the command:
Java-jar ****.jar
Always runs the specified main method after execution, and if there are multiple main methods in the jar, how do you run the specified main method?
Try this with the following command:
Java-classpath ****.jar ****.****.classname [args]
"****.****" means "package name";
"ClassName" means "class name";
"[args]" indicates the parameters passed in;
Run MANIFEST directly. The main method specified in MF:
Java-jar Mplus-service-jar-with-dependencies.jar
To run the specified Main method:
JAVA-CP Mplus-service-jar-with-dependencies.jar com.smbea.dubbo.bin.Console Start
This article on the Java Implementation Jar package in the main method is small to share all the content of everyone, hope to give you a reference, but also hope that we support the cloud habitat community.