0

I have recently migrated to Eclipse from another IDE.

I use an ANT file to compile a legacy Java webapp I am taking care of.

Here is a snipped of the specifications for compiling it in my build.xml:

   <target name="build" description="Compile main source tree java files">
        <mkdir dir="${build.dir}"/>
        <javac destdir="${build.dir}" source="${javaversion}" target="${javaversion}" debug="true"
               deprecation="false" optimize="false" failonerror="true"
               fork="yes" executable="${appserver.jdk}">
            <src path="${src.dir}"/>
            <classpath refid="master-classpath"/>
        </javac>
    </target>

When I run just the build.xml I get just 2 warnings ( about some deprecated libraries ).

However, when I open the project up in Eclipse, I got over 100 warnings about interesting things such as blocks of dead code, better declaring collections, etc?

Where do all of these "new" warnings come from in Eclipse? Is it part of the JDT or a third party Java tool that any IDE ( or wo/man with a command prompt and a JDK installation ) can use?

4

2 回答 2

1

Eclipse 使用自己的编译器

一个增量 Java 编译器。作为 Eclipse 构建器实现,它基于从 VisualAge for Java 编译器演变而来的技术。特别是,它允许运行和调试仍然包含未解决错误的代码。

如果您愿意,可以从命令行将其用作批处理编译器。

于 2013-07-02T18:50:29.213 回答
0

在 Eclipse 中,转到 Window -> Preferences。在那里,深入到 Java -> 编译器 -> 错误/警告。除了 Java 编译错误之外,这就是 eclipse 将标记为警告和错误的所有设置。

于 2013-07-02T19:00:14.840 回答