java -cp execution of a class jar package

When we need to test a function, we need to execute the main method of a class in a linux environment to test

You can use java -cp xxx.jar com.MyClass to perform a class

java -cp test.jar:lib/* com.Test

 Wherein the test.jar com.Test is a class, lib / * is test.jar dependent jar package,

 -cp and -classpath as other classes classes specified path running over this, usually library, jar package and the like, need the full path to the jar package, the window semicolon ";", the linux colon ":"

Guess you like

Origin www.cnblogs.com/qixing/p/11457728.html