gpt4 book ai didi

eclipse - "Ignoring InnerClasses attribute"警告正在终止 Eclipse

转载 作者:行者123 更新时间:2023-12-02 21:16:56 25 4
gpt4 key购买 nike

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

[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 由于内存溢出错误而崩溃。现在我无法构建任何东西,即使是在我的计算机启动后也是如此。

解决方案似乎是重新编译源代码(开源和所有),但除了 Maven 之外,其他任何源都不能重新编译,在这样做无济于事之后,我怀疑是在第一名。

我不关心警告的结果,只是 Eclipse 不会花费所有内存来告诉我这一点。那么,有没有办法可以消除这个问题,或者让 Eclipse 停止减慢速度(也许可以跳过该检查)?

最佳答案

这给我带来了很大的痛苦 android-maven-plugin以及其他包含 commons-logging 的库。它阻碍了我的构建。更糟糕的是,一些库是传递性包含的,所以只需使用 <exclude>行不通。来自 another post 的一点提示,我决定可以用这样的方法将有问题的库完全排除在外:

    <!-- 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 - "Ignoring InnerClasses attribute"警告正在终止 Eclipse,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5591811/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com