Possible Duplicate:
Setting multiple jars in java classpath
I am wondering if I can use a wild card to specify jars in the
java -cp *.jar
command ?
Possible Duplicate:
Setting multiple jars in java classpath
I am wondering if I can use a wild card to specify jars in the
java -cp *.jar
command ?
Yes, as of Java 6. I don't think this ability existed in previous versions, so for older programs you'll often see shell scripts manually building up the classpath based on the contents of a directory.
Class path entries can contain the basename wildcard character *, which is considered equivalent to specifying a list of all the files in the directory with the extension .jar or .JAR. For example, the class path entry foo/* specifies all JAR files in the directory named foo. A classpath entry consisting simply of * expands to a list of all the jar files in the current directory.
http://docs.oracle.com/javase/6/docs/technotes/tools/windows/classpath.html
It'll basically depend on the context, i.e. if the interpreter will explode or not the *.jar
expression.