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

Runtime.exec throws IOException when directory parameter contains GB18030 char

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 6
    • core-libs

      ENVIRONMENT:
      Windows

      SUN JDK VERSION:
      Recreated with 1.6.0_18


      STEPS To Recreate:
      -create a directory named NewFolder? in the current directory.
      --javac HelloWorld.java
      --javac ExecGB18030.java
      --java ExecGB18030

                                                  
      Observed output:
      $ java ExecGB18030
      Running command 'java HelloWorld' in dir './NewFolder???'
      java.io.IOException: Cannot run program "java" (in directory ".\NewFolder???"):
      CreateProcess error=267, The directory name is invalid
              at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
              at java.lang.Runtime.exec(Runtime.java:593)
              at java.lang.Runtime.exec(Runtime.java:431)
              at ExecGB18030.main(ExecGB18030.java:14)
      Caused by: java.io.IOException: CreateProcess error=267, The directory name is invalid
              at java.lang.ProcessImpl.create(Native Method)
              at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
              at java.lang.ProcessImpl.start(ProcessImpl.java:30)
              at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
              ... 3 more
      >>> FATAL

      Expected output:
      Running command 'java HelloWorld' in dir './NewFolder?'
      >>> SUCCESS

            Unassigned Unassigned
            dkorbel David Korbel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: