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

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

问题描述

我有几个导入的 jars 在项目构建时在 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 之外,其他任何东西都不能重新编译,在这样做无济于事之后,我怀疑是导致问题的原因第一名.

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 不会把所有的内存都花在告诉我这件事上.那么,有没有一种方法可以解决这个问题,或者让 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 和其他包含 commons-logging 的库感到非常痛苦.它阻止了我的构建.更糟糕的是,一些库被传递地包含在内,所以简单地使用 是行不通的.借助另一篇文章的一点提示,我决定可以通过以下方式完全排除违规库:

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>

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

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