java -jar
java -jar myClass.jar
* When the command is executed , Directory will be used META-INF\MANIFEST.MF file ,
* In this file , There is one called Main-Class Parameters of , It says java -jar Command execution class
java -jar *.jar param1 param2
* function jar package , Will automatically arrive jar Query in package mainfest Start class defined in and run
* param1,param2 by main Parameters of the method may not be filled
java -cp
* java -cp and -classpath equally , Is the path of other classes on which the specified class runs , Usually a class library ,jar Bags and stuff , Full path to jar package ,
* window Semicolon above “;”
* linux Semicolon above “:”
java -cp .;myClass.jar packname.mainclassname
* Expression supports wildcards , for example :
* java -cp .;c:\classes01\myClass.jar;c:\classes02\*.jar
packname.mainclassname
java -cp lib/*;etc/ com.Start param1 param2
* take lib All under jar Documents and etc All profiles under add to classpath in
* And classpath Looking for com.Start class (main Method class ) And run
* param1,param2 by main Parameters of the method may not be filled
* be careful :jar File import classpath, Wildcard cannot be written as *.jar, Use only * or 123*
* be careful : Profile import classpath, Can only write to directory /, Cannot add *
Technology
Daily Recommendation