DEV Community

Andy Brunner
Andy Brunner

Posted on

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

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

Top comments (0)