Hi all,
here's what I'm doing, and why:
PATH=target/downloads/zulu11.41.24-sa-jdk11.0.8-win_i686/bin:$PATH checker-framework-3.13.0/checker/bin/infer-and-annotate.sh GuiEffectChecker "$(echo target/lib/* | tr ' ' :)" $(find src/main/java *.java) $(find src/test/java *.java)
Output:
checker-framework-3.13.0/checker/bin/javac: line 38: target/downloads/zulu11.41.24-sa-jdk11.0.8-win_i686/bin/java: Argument list too long
Which comes as no surprise to me: that's 2315 files with a total length of 162850 filename characters, which would be too much for any shell.
How do I reduce the command-line length?
I have been considering compiling the sources into a .jar first and having an empty set of source files, but I'd likely run into the exact same problem when I try to merge the output into the .java files.
Will it work if I put the names into java-sources.txt and use @java-sources.txt on the infer-and-annotate.sh command?
Any help appreciated!
Regards,
Jo
Background details for the curious:
target/downloads/zulu11.41.24-sa-jdk11.0.8-win_i686/bin:$PATH sets the path to include the Java binaries (they're downloaded as part of a pre-existing machinery that we use because corporate setup never installs quite the Java version that we expect).
It's not an absolute path, so it's susceptible to problems if anything does a cd command, though I don't think it's the problem here (the script thankfully reports the javac command line, and shows the right command is being run).
"$(echo target/lib/*.jar | tr ' ' :)" picks up the .jar files in the target/lib directory (blank-separated by the shell), and replaces the blanks with : characters to form a classpath. (The : may be the wrong separator since it's a Windows javac running under Cygwin, but I believe javac fails before looking at the classpath.)
I'd really have preferred to directly use javac's target/lib/* classpath syntax, but the star doesn't make it through the scripts - likely the parameter isn't properly quoted.