用蚂蚁和Java 1.7编译问题 [英] Compile problems using ant and Java 1.7

查看:1141
本文介绍了用蚂蚁和Java 1.7编译问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图编译使用蚂蚁和javac的1.7编译器code基地。
目前,code编译基地使用1.6编译器,但是当我切换到1.7编译器,我得到了以下两个怪事。

1)我得到一个警告:警告:X是内部的私有API并可能在将来的版本中删除,其中x是一个内部私有的API的一部分,但在$ C $行c将其引用不引用X(也没有引用给定文件x中的任意位置)。这发生在少数地方和它引用行是注释块。

2)编译如下终止:


  [javac的]该系统是资源不足。
[javac的]详细信息请参考下面的堆栈跟踪。
[javac的] java.lang.StackOverflowError
[javac的]在com.sun.tools.javac.comp.Attr.attribTree(Attr.java:418)
[javac的]在com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:460)
[javac的]在com.sun.tools.javac.comp.Attr.visitBinary(Attr.java:2053)
[javac的]在com.sun.tools.javac.tree.JCTree $ JCBinary.accept(JCTree.java:1565)


这是我用于javac Ant脚本相关的参数是:


 源=1.6
        目标=1.6
        调试=上
        DEBUGLEVEL =行,增值分销商,源
        nowarn =上
        叉=YES
        可执行=C:\\ Program Files文件\\的Java \\ jdk1.7.0_04 \\ BIN \\ javac的
        memorymaximumsize =1500米


我试图改变源和目标的版本。我也试过院校布局结构调整的内存大小。它似乎并没有帮助。


解决方案

(复制只是我一个答案评论,在情况下,它原来是答案。)

这可能是一个Java编译器7的bug。但是,您可以通过运行的javac -Xss16M 参数给编译器更多的内存。这使得线程堆栈大小16MB VS 1MB的默认值。这可能是一个可行的解决方法。

关于内部API的信息是不相关的,并且可以被忽略。

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 javac with 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.

这篇关于用蚂蚁和Java 1.7编译问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆