views:

174

answers:

4

When running java from the command line:

java -classpath bin:pellet-2.0.0/lib/* com.stuff.MyClass argumentTextStuff

I'm getting the following reply:

java: No match.

What's this mean? which java points to the expected file. And if I take the asterisk out, then I get the expected class not found error. Google searches aren't fruitful because I keep getting stuff about matching regexp patterns.

+2  A: 

That is a bash (or whatever shell are you using) error message not a java one.

It means that "bin:pellet-2.0.0/lib/*" doesn't match any file.

Do not use wildcards in classpath.

andcoz
It was a tcsh shell error because tcsh treats the `*` symbol differently than bash. Actually, file globbing works as it should in bash and using the asterisk is greatly preferred over listing the twenty or so jar files that are represented by the asterisk.
John Berryman
Ops, you are right :( I am so used to be the "only one" to use tcsh that I was sure you was using the bash. In any case, I do not agree that "globbing works as it should" in bash. I still prefer a shell that doesn't try to guess on which I want.
andcoz
+1  A: 

If the * makes the difference, then the issue is probably related to how it's interpreted and by who. Try escaping it so that it's passed as is to java.

See also

polygenelubricants
+1  A: 

Ah... already figured it out. It worked when I was using a bash shell, however the * is treated differently in the tcsh shell. So we switched to bash and it works. The reason is described here (per polygenelubricants's suggestion in the comments below).

John Berryman
See links like http://www.macosxhints.com/article.php?story=20020314095714397 (`set nonomatch`) ; http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/ (Stupid parsing bugs) ; it's more than fine to answer your own question, but you should still do it in such a way to make it beneficial to the community as a whole.
polygenelubricants
agreed... I've been in the thick of things until this moment and couldn't post anything more helpful.
John Berryman
A: 

With a unix Shell you often need to put such things in single or double quoted to ahold the Shell expanding the asterisk.

Thorbjørn Ravn Andersen