java java -cp_java -cp用法

原文出处:http://blog.csdn.net/zhuying_linux/article/details/7714194。感谢作者的分享

java -cp classpath

Specify a list of directories, JAR archives, and ZIP archives to  search  for  class  files.  Class  path entries  are separated by colons (:). Specifying -classpath or -cp overrides any setting of the CLASSPATH environment variable.

As a special convenience, a class path element containing a basename of  * is considered equivalent to specifying a list of all the files in the directory with the extension .jar or .JAR (a java program  cannot  tell the difference between the two invocations).

For  example,  if directory foo contains a.jar and b.JAR, then the class path element foo/* is expanded to a A.jar:b.JAR, except that the order of jar files is unspecified. All jar files in  the  specified  directory, even  hidden  ones,  are included in the

list. A classpath entry consisting simply of * expands to a list of

你可能感兴趣的:(java,java,-cp)