macOS Shell: Include all jar files in Java -cp argument

Andy Brunner - Sep 2 - - Dev Community

Just found a single line of a macOS shell to start a Java program which sets the classpath by including all jar files from a directory:

run.sh

java -cp "../bin/:../lib/*" $1
Enter fullscreen mode Exit fullscreen mode

Execute it with

./run.sh Test
Enter fullscreen mode Exit fullscreen mode
. . . . . . . . . .
Terabox Video Player