> On Jun 7, 2024, at 08:11, Christopher Schultz <ch...@christopherschultz.net> > wrote: > > On 6/7/24 01:49, Mark Thomas wrote: >> On 06/06/2024 18:48, Dave Breeze wrote: >>> Thanks Mark >>> appreciate that the url was for 8.0 >>> >>> With regards to classpath that was my first attempt - unfortunately it >>> would seem that Tomcat does not support wildcards in the classpath - >>> for example dirpath/lib/*.jar - at least in version 9. >> The requirements for setting the class path are set by the JVM, not by >> Tomcat. If you want all the JARs in a directory to be included in the class >> path then you should add dirpath/lib/* to the class path. > > I think you'd have to specifically mention every .jar file in that directory > in the classpath, right? I've never known Java to bother resolving glob > patterns on its own. This is usually the responsibility of the command shell.
As Mark stated, you can use an asterisk appended to a directory path in the CLASSPATH value to add all of the jars in that directory to the classpath. (It’s been that way since Java 6.) This works even without shell expansion. For example, java -cp mylib/* ClassName does use shell expansion, but will fail if there is more than one file in mylib, since the shell doesn’t generate path separators. These constructs: java -cp .:mylib/* ClassName [works in bash, zsh will complain] java -cp ‘mylib/*’ ClassName do not use shell expansion, since a Linux/UNIX shell is put off by the colon or apostrophes. - Chuck --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org