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

# character for file path in arguments file causes javac command to fail

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4
    • tbd
    • 8u172
    • tools
    • os_x

    Description

      This was first reported as an issue in the Ant project[1]. However, looking into it, it appears to be an issue in javac (Java 8 installation) command itself.

      Consider the following arguments file (args.txt):

      -d del#me

      The del#me is a directory (within the current working dir). Run:

      javac @args.txt Foo.java

      (where Foo.java is any valid Java file). This throws the following error (only on Java 8):

      javac: directory not found: del
      Usage: javac <options> <source files>
      use -help for a list of possible options

      Now edit the args.txt to quote the argument value as follows:

      -d "del#me"

      and then run the javac command again:

      javac @args.txt Foo.java

      This time it passes without issues and generates the class file in the del#me directory.
      This issue is reproducible only on Java 8 installation. More specifically I'm on:

      javac -version
      javac 1.8.0_172
      (this is also reproducible on latest AdoptOpenJDK 8 version 1.8.0_265). I'm on a macOS.





      [1] https://bz.apache.org/bugzilla/show_bug.cgi?id=64912

      Attachments

        Activity

          People

            jlahoda Jan Lahoda
            jpai Jaikiran Pai
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: