I am trying to compile a code base using ant and the javac 1.7 compiler.
Currently, the code base compiles using the 1.6 compiler but when I switch to the 1.7 compiler, I get the following two oddities.
1) I get a warning: “warning: x is internal proprietary API and may be removed in a future release” where x is part of an internal proprietary API yet the line in the code it references does not reference x (nor does it reference x anywhere in the given file). This happened in a few places and the line it references is in a comment block.
2) The compile terminates with the following:
[javac] The system is out of resources. [javac] Consult the following stack trace for details. [javac] java.lang.StackOverflowError [javac] at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:418) [javac] at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:460) [javac] at com.sun.tools.javac.comp.Attr.visitBinary(Attr.java:2053) [javac] at com.sun.tools.javac.tree.JCTree$JCBinary.accept(JCTree.java:1565)
The relevant parameters that are in my ant script for javac are:
source="1.6" target="1.6" debug="on" debuglevel="lines,vars,source" nowarn="on" fork="yes" executable="C:\Program Files\Java\jdk1.7.0_04\bin\javac" memorymaximumsize="1500m"
I tried changing the source and target versions. I also tried ajusting the memory size. It does not seem to help.
(Just copying my comment to an answer, in case it turns out to be the answer.)
This may well be a Java 7 compiler bug. You can however give the compiler more memory by running
javacwith an argument like-Xss16M. This makes the thread stack size 16MB vs default of 1MB. It may be a viable workaround.The message about internal APIs is unrelated and can be ignored.