RFR - 8027634: Support @argfiles for java command-line tool

Erik Joelsson erik.joelsson at oracle.com
Mon Aug 10 10:02:06 UTC 2015


Hello Henry,

Build changes look good to me.

/Erik

On 2015-07-10 05:48, Henry Jen wrote:
> Hi,
>
> Please review proposed patch for JDK-8027634[1]. This patch is to enable java support command line argument file like javac does. The implementation use the same syntax rule, which is implemented in CommandLine.java[3] with java.io.StreamTokenizer.
>
> Some early comment is that we probably don’t need such complexity to support same syntax, also require to quote whole token is a little inconvenient. For example, must be -cp “c:\\foo bar\\lib;c:\\lib” instead of -cp c:\”foo bar”\lib;c:\lib.
>
> I am debating if such compatibility is necessary useful, after all, easy and intuitive is more important, and with simpler rule, the implementation will be cleaner as well.
>
> Anyhow, with the patch out, at least developer can build idk and have something to test with to see if this can fulfill their use cases.
>
> Also, for tools other than java that use launcher, it’s possible to use -J at argfile to pass arguments. For example, if want to pass -J options to javac, it’s now possible to do so with javac -J at argfile, and put -J options in the argfile.
>
> If the consensus is that such syntax compatibility is not important, we will go ahead remove the escaping support(except probably enable escape for quote itself) in quote, and maybe add support of quote within a token.
>
> CCing build-dev for build changes, jdk9-dev for wider audience for tools.
>
> Cheers,
> Henry
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8027634
> [2] http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javac.html#commandlineargfile
> [3] http://hg.openjdk.java.net/jdk9/jdk9/langtools/file/03e083639ee9/src/jdk.compiler/share/classes/com/sun/tools/javac/main/CommandLine.java



More information about the jdk9-dev mailing list