jpackager has it's own simplistic implementation of @argfile.
In order to have the same implementation of this code is in javac, we should just take a copy of src/jdk.compiler/share/classes/com/sun/tools/javac/main/CommandLine.java, change only the package name, and include it in jpackage.
If at some future point this migrates to a public API or even an internal jdk module, we can just call it. In the meantime we can maintain this copy.
In order to have the same implementation of this code is in javac, we should just take a copy of src/jdk.compiler/share/classes/com/sun/tools/javac/main/CommandLine.java, change only the package name, and include it in jpackage.
If at some future point this migrates to a public API or even an internal jdk module, we can just call it. In the meantime we can maintain this copy.