Reputation: 136221
Consider the following command which runs flawlessly using bash
:
java -classpath bin:lib/* FunctionalTests.TestRunner
The classes are in bin
, jars are in lib
, main()
is in bin/FunctionalTests/TestRunner
:
.
├── bin
├── lib
│ ├── commons-collections-3.2.1.jar
│ ├── commons-httpclient-3.1.jar
│ ├── commons-io-2.1.jar
│ ├── commons-lang-2.4.jar
│ ├── commons-logging-1.1.1.jar
│ └── ...
└── src
When the same command runs with zsh
, the output is:
zsh: no matches found: ./bin:./lib/*
Any ideas?
Upvotes: 3
Views: 6831
Reputation: 1302
Try to use something like this to add every .jar in the classpath:
CP=bin
for i in lib/*.jar
do
CP=$CP:${i}
done
java -classpath $CP FunctionalTests.TestRunner
Upvotes: -1
Reputation: 136221
It boils down to another pair of quotes:
java -classpath "bin:lib/*" FunctionalTests.TestRunner
Hope it helps someone in the future.
Upvotes: 19