JDK-8027634 : Support @argfiles for java command-line tool
  • Type: Enhancement
  • Component: tools
  • Sub-Component: launcher
  • Affected Version: 7
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • Submitted: 2013-03-20
  • Updated: 2017-05-17
  • Resolved: 2015-08-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b80Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8134259 :  
JDK-8177359 :  
Description
A DESCRIPTION OF THE REQUEST :
The javac command-line tool overcomes command-line length limitations using the @argfiles option. Unfortunately, the java command-line tool runs into the same limitations but does not support @argfiles.

Please add @argfiles to the java command-line tool.

JUSTIFICATION :
See http://netbeans.org/bugzilla/show_bug.cgi?id=224293 for an example of a reasonable command-line that fails to execute due to command-line length limitations.
Comments
@ Kumar - thanks for the answer.
12-08-2015

Are the JNI invocation APIs capable of handling UTF-8 ? And the answer is : JDK-4858889
12-08-2015

@Kumar - I am new to the discussion, and added myself to the watch list because I need the functionality. I took a peek at the document, and it seems clean, but the use of ASCII was jarring. Why not just say UTF-8 (which is ASCII compatible) ? If you guys have bashed this topic to death, please just say so and I will go back to waiting for the impl.
12-08-2015

New version is now pending spec approval and code review, http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-August/034870.html
11-08-2015

Code review is posted at http://cr.openjdk.java.net/~henryjen/jdk9/8027634/v2/webrev/ Email request for review, http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-July/034595.html Syntax of argument file is similar to command line argument file used for javac[1] with following modification: 1) White space characters are one of ' \t\n\r'. 2) Partial quote is allowed, that is, lib/"cool app"/jars is one single token as "lib/cool app/jars" 3) Open quote stop at EOL unless '\' is the last character, which will join next line by removing all leading white space characters. So that, -cp "/lib/cool app/jars:\ /lib/another app/jars" is same as -cp "/lib/cool app/jars:/lib/another app/jars" 4) Escaping sequence in quote is limited to '\n' and '\r', everything else other than EOL is just next character. [1] http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javac.html#commandlineargfile
18-07-2015

Code review comment on JDK-8061999 are welcome.
08-07-2015

You should be aware of the new vm -XX:VMOptionsFile to hold command-line arguments to the jvm for use by any launcher. JDK-8061999.
08-07-2015