Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7020954

Different Behavior in java.exe among windows editions and c libraries when "*" is set as an argument

XMLWordPrintable

    • x86
    • windows_2008

      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.

            ksrini Kumar Srinivasan
            tbaba Tadayuki Baba (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: