EVALUATION
http://hg.openjdk.java.net/hsx/hotspot-comp/jdk/rev/2dd41a2dfe54
|
|
|
EVALUATION
http://hg.openjdk.java.net/hsx/hotspot-main/jdk/rev/2dd41a2dfe54
|
|
|
EVALUATION
See also MS's release notes:
http://msdn.microsoft.com/en-US/library/ms235497%28v=VS.80%29.aspx
|
|
|
SUGGESTED FIX
Stop linking with setarg.obj, however this could cause other side-effects
with the launcher wildcard processing behavior.
|
|
|
EVALUATION
This started to happen when the compilers were updated from VC2003 to VS2010.
The launcher links with VS2010's setargv.obj which exhibits a different
behavior, which is reported here and closed by MS.
http://connect.microsoft.com/VisualStudio/feedback/details/98756/vs2005-setargv-obj-wildcard-handling-broken
In the previous versions the wildcard parameter was passed intact to
the launcher which would invoke its own wildcard expansions, but now
the setargv.obj decides to expand the wildcard inhibiting the launcher's
logic.
The debug output in the case where it works and the wildcard compononent
is passed to the launcher directly,
<snip>
430624 micro seconds to LoadJavaVM
Expanded wildcards:
before: "lib\*"
after : "lib\a.jar;lib\b.jar"
<snip>
|
|
|
PUBLIC COMMENTS
In the failing case it appears as if the wildcard expansion is happening in the "shell". Consequently:
java -cp lib/* test.B
becomes
java -cp lib/a.jar lib/b.jar test.B
which naturally fails. I'm not sure why anyone would even think that a wildcard on a classpath option should actually work as the multiple entries would not form a single path definition with the necessary path seperator etc.
In the working case the launcher sees a single arg of "lib/*;"
|
|
|
PUBLIC COMMENTS
Put this program in a dir and compile it:
class Bug {
static public void main(String args[]) {
for (String ss: args) System.out.println("ss - " + ss);
}
}
Then run it like this:
java Bug "./*"
On windows, in a 'cmd' shell, the following is output:
6u29:
ss = ./*
7:
ss - ./Bug.class
ss - ./Bug.java
This is a change in behavior from 6 to 7.
In a cygwin shell, this is output by both jdk 6 and 7:
ss - ./Bug.class
ss - ./Bug.java
On solaris, this is output by both jdk 6 and 7 in csh, sh, bash:
ss = ./*
The above shows what gets passed to a program for "./*".
The section "Understanding class path wildcards" here:
http://docs.oracle.com/javase/7/docs/technotes/tools/windows/classpath.html
shows what is supposed to happen if you do manage to get ./* into the classpath seen by the java launcher.
|
|
|