Wild cards were introduced from Java 6. 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.
java -cp "lib/*" -jar %MAINJAR%
If you need only specific jars, you will need to add them individually. The classpath string does not accept generic wildcards like Jar*, .jar, hiber etc.
Comments
Please check this thread.
Wild cards were introduced from Java 6. 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.
java -cp "lib/*" -jar %MAINJAR%
If you need only specific jars, you will need to add them individually. The classpath string does not accept generic wildcards like Jar*, .jar, hiber etc.
Example
The following entry does not work:
java -cp "Halo.jar;lib/*.jar" ni.package.MainClass
Correct entry is :
java -cp "Halo.jar;lib/*" ni.package.MainClass
More about....Java Classpath
Robert