“忽略InnerClasses属性”警告正在杀死Eclipse [英] "Ignoring InnerClasses attribute" warning is killing Eclipse

查看:230
本文介绍了“忽略InnerClasses属性”警告正在杀死Eclipse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在项目建立时,我有几个导入的jar在Eclipse中出现错误:

I have a couple of imported jars that have this error in Eclipse when the project builds:

[2011-04-08 16:31:48 - MokbeeAndroid] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(net.sf.antcontrib.logic.ForEach$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.

现在,我一开始并不在意,因为没有错误。但是现在我已经添加了Apache Sanselan,它也有同样的问题。其他Apache jar也可以做到这一点,而不仅仅是每个jar一次,而是每一个类 - 一个内在的类,这使得每个构建泵都出了一个可怕的控制台日志。更糟糕的是,每个警告似乎都减慢了Eclipse构建过程,最终Eclipse只是因为内存溢出错误而崩溃。这是在我无法建立任何东西的地方,甚至在我的电脑启动后也是这样。

Now, I didn't really care at first, because there were no errors. But I've now added Apache Sanselan, which has the same problem. Other Apache jars also do this, and not just once per jar, but once per class-that-has-an-inner-class, which makes every build pump out a monstrous console log. Worse, each warning seems to slow the Eclipse build process, and eventually Eclipse just crashes due to a memory overflow error. It's at the point where I can't build anything, even straight after my computer starts up.

该解决方案似乎是重新编译源代码(开源和所有),但是除了Maven之外,除了Maven之外,没有一个可以重新编译,我怀疑是首先引起问题。

The solution would seem to be to recompile the source (open-source and all), but none of it can be recompiled in anything but Maven, which, after doing so to no avail, I suspect is causing the problem in the first place.

我不在乎警告的结果,只是Eclipse不会把所有的内存都告诉我。那么,有没有办法可以删除这个问题,或者是让你停止放慢它(跳过那个检查,可能)?

I don't care about the results of the warning, just that Eclipse doesn't spend all it's memory on telling me about it. So, is there a way I can either remove the problem, or make Eclipse stop slowing down on it (skipping that check, maybe)?

推荐答案

这使我感到非常痛苦, android-maven-plugin 和其他包含共享记录。它阻挡了我的构建。更糟糕的是,一些图书馆被过渡化,所以简单地使用< exclude> 将不起作用。来自另一篇文章的一些提示,我确定我可以把这样的事情完全放在违规图书馆上:

This was causing me a lot of pain with the android-maven-plugin and other libraries that included commons-logging. It was blocking my build. What made it worse is that some libraries were included transitively, so simply using <exclude> would not work. With a little hint from another post, I determined I could keep out the offending library altogether with something like this:

    <!-- prevent commons-logging from being included by the Google HTTP client 
        dependencies -->
    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.1.1</version>
        <scope>provided</scope>
    </dependency>

这篇关于“忽略InnerClasses属性”警告正在杀死Eclipse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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