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

strange java 7 behavior on windows ( star arg "*")

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 7
    • tools
    • x86
    • windows_7

      FULL PRODUCT VERSION :


      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      've notice a strange java 7 behavior on windows when a "*" is used as argument:

      Here is the test case, just printed out the args (pretty simple as you can see):

          public class TestStar
          {
            public static void main(String args[])
            {
              for (String _arg : args)
              {
                System.out.print(_arg + " ");
              }
              System.out.println();
            }
          }

      On Unix, running ' java TestStar "*" ', both on jdk6 and jdk7 produce the expected output:

          $ echo $JAVA_HOME

          $ ./jdk1.6.0_26/bin/java -version
          java version "1.6.0_26"
          Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
          Java HotSpot(TM) Server VM (build 20.1-b02, mixed mode)
          $ ./jdk1.6.0_26/bin/java TestStar "*"
          *
          $ ./jdk1.7.0/bin/java -version
          java version "1.7.0"
          Java(TM) SE Runtime Environment (build 1.7.0-b147)
          Java HotSpot(TM) Server VM (build 21.0-b17, mixed mode)
          $ ./jdk1.7.0/bin/java TestStar "*"
          *
          $

      On windows with jkd6, I've got the expected output:

          $ echo %JAVA_HOME%
          %JAVA_HOME%

          $ c:\Program Files\Java\jdk1.6.0_29\bin\java.exe -version
          'c:\Program' is not recognized as an internal or external command,
          operable program or batch file.

          $ "c:\Program Files\Java\jdk1.6.0_29\bin\java.exe" -version
          java version "1.6.0_29"
          Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
          Java HotSpot(TM) Client VM (build 20.4-b02, mixed mode, sharing)

          $ "c:\Program Files\Java\jdk1.6.0_29\bin\java.exe" TestStar "*"
          *

          $


      On windows with jkd7, the output **IS NOT** the expected one. It seems that the "*" is interpreted and list the directory

          $ "c:\Program Files\Java\jdk1.7.0_03\bin\java.exe" -version
          java version "1.7.0_03"
          Java(TM) SE Runtime Environment (build 1.7.0_03-b05)
          Java HotSpot(TM) Client VM (build 22.1-b02, mixed mode, sharing)

          $ "c:\Program Files\Java\jdk1.7.0_03\bin\java.exe" TestStar "*"
          TestStar.class

          $ "c:\Program Files\Java\jdk1.7.0_03\bin\java.exe" TestStar "\*"
          \$Recycle.Bin \a.bat \autoexec.bat \bar.emf \config.sys \dell \Documents and Set
          tings \FWLog.txt \Genius \hiberfil.sys \HP_CLJ_CP4020_CP4520_32bit_PCL6_HPDIU \H
          PDIU.log \MSOCache \pagefile.sys \partage \PerfLogs \Program Files \ProgramData
          \Recovery \System Volume Information \Users \Windows \xampp

      REGRESSION. Last worked in version 7


      REPRODUCIBILITY :
      This bug can be reproduced always.

            ksrini Kumar Srinivasan
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: