JDK-7020954 : Different Behavior in java.exe among windows editions and c libraries when "*" is set as an argument
  • Type: Bug
  • Component: tools
  • Sub-Component: launcher
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2008
  • CPU: x86
  • Submitted: 2011-02-21
  • Updated: 2012-09-11
  • Resolved: 2012-09-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Resolved
Related Reports
Duplicate :  
Relates :  
Description
A CU sent a report that different behavior of java command among Windows Server versions
when "*" is set as an argument of java command.


CONFIGURATION:
OS : Windows Server  2003��Windows Server 2008
JDK : 5.0ux/jdk6/jdk7

REPRODUCE:
1. Compile the following program.
------------------------------------------------------------
class a {
  public static void main(String[] args) throws Throwable {
    for (String s : args)
      System.out.println(s);
  }
}
------------------------------------------------------------

2. Invoke the following command line.
    c:\Users\licensees> java a "*"


In Windows Server 2003, argument parser passes *(asterisk as a character).
In Windows Server 2008, this is recognized as wild card.
(file list under the current directory is created)

Furthermore, similar different behavior occurs among different JDK versions.

The following results are in Windows Server 2008.

-------
E:\xxx\Java>d:\jdk\15027\bin\java -showversion a "*"
java version "1.5.0_27"
Java(TM) Platform, Standard Edition for Business (build 1.5.0_27-b02)
Java HotSpot(TM) Client VM (build 1.5.0_27-b02, mixed mode)

a.class
a.java

E:\xxx\Java>d:\jdk\sun\60u14\bin\java -showversion a "*"
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode)
 
*

E:\xxx\Java>d:\jdk\sun\jdk7ea-b128\jdk1.7.0\bin\java -showversion a "*"
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b129)
Java HotSpot(TM) Client VM (build 21.0-b01, mixed mode)

a.class
a.java

--------

More details related to cause are described in comment section.
Please see that also.

Comments
EVALUATION Yes the wildcard behavior was changed in VS2005, as of JDK8 and JDK7u10 we no longer depend on the behavior of setargv.obj, see 7146424. The launcher has its own command line parsing component. Thus we can expect to see the 6uX behavior, ie. before we switched to VS2005.
11-09-2012