RFR - 8027634: Support @argfiles for java command-line tool
henry.jen at oracle.com
Fri Jul 10 03:48:28 UTC 2015
Please review proposed patch for JDK-8027634. 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 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.
More information about the jdk9-dev