I observe a strange behavior of wildcard expansion behavior for Java7 on Windows.
For centuries there was a clean difference between "*" versus *.
Seems this it not longer true for Java7 (at least on Windows7).
I noticed the problem when using a wildcard classpath.
In despite of quoting the wildcard-classpath it gets expanded.
Thus it seems not possible any more to pass a wildcard to the java application.
So using java -cp "somewhere/*"
will fail (as does "somewhere\*"
).
A workaround seems to be: java -cp "somewhere/*;"
which inhibits the expansion.
To verify the behavior I wrote a small Echo.java class.
I found that using java 1.6.0 quoted "*" and plain * works like expected, whereas on Java7 I always got the expanded wildcard. Until now this was observed on Windows7, don't know what happens on XP.
The problem arises, since wildcards on Windows are never ever expanded by dark age CMD.EXE (like any shell does on UNIX). Instead each executable has to perform this explicitly using setargv.obj.
I found two related issues which seem to describe a similar problem:
Is this observed by someone else?
Or are there some obscure Windows or batch-file settings to control this?
Dieter.
Yes, I noticed the same issue.
It's explained as a 'known issue' in the release notes for Java7 update 4.
Here is the bug report. The fix will be delivered in Java7 update 8 (current release is update 6).
Note that there isn't a shell-options workaround, because in Windows, the shell doesn't handle wildcard expansion. (Whereas in Unixes, the shell performs the expansion).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With