Compile problems with ant and Java 1.7

I am trying to compile a code base using ant and the javac 1.7 compiler. Currently, the code base is compiled using compiler 1.6, but when I switch to compiler 1.7, I get the following two oddities.

1) I get a warning: "warning: x is an internal proprietary API and may be removed in a future version", where x is part of the internal API, but the line in the code that it refers to does not refer to x (and it refers to x anywhere in this file). This happened in several places, and the line to which it refers is in the comment block.

2) Compilation is completed as follows:

[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) 

Relevant parameters that are in my ant script for javac:

  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 to change the source and target versions. I also tried resizing the memory. It doesn't seem to help.

+4
source share
1 answer

(Just copying my comment on the answer if it turns out to be the answer.)

This might be a Java 7 compiler error. However, you can give the compiler more memory by running javac with an argument like -Xss16M . This makes the default 16MB thread stack size 1MB. This can be a viable solution.

The internal API message is unrelated and may be ignored.

+3
source

All Articles