忽略编译错误 - Java [英] Ignoring Compilation errors - Java

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

问题描述

我有大约1500个文件要编译,其中15-20个文件有编译错误。这些文件不在我的控制,所以我不能做任何修改/更新/删除。所以,我有两个问题。

I have around 1500 files to compile, in which 15-20 files have compilation errors. These files are not under my control, so I could not do any modification/update/delete. So, i have two questions here.

1)如何忽略这些15-20文件的编译错误,并继续生成.class文件的其余部分。是有任何javac命令行选项或任何将忽略并发错误,并产生所有其他非错误文件的.class文件。

1) how do i ignore the compilation errors from these 15-20 files and continue to produce the .class file for rest of them. is there any javac commandline option or anything which will ignore the compliation errors and produce the .class files for all other non error files.

2)将java编译器中止编译一旦它看到这些错误或将继续编译(产生.class文件)一切,然后结束然后抱怨这些文件有错误。

2)will the java compiler abort compilation as soon as it sees these errors or will it continue compiling(producing .class files) everything else and at the end then complain about these files with errors.

推荐答案

您可以使用 Eclipse 。它的内部编译器 - 至少在某些情况下 - 能够继续与其余的构建,即使一些类没有完全编译。如果可能的话,它甚至会为破坏的类生成类文件,生成一旦调用就抛出异常的方法。

You can use Eclipse. Its internal compiler is - at least in some cases - able to keep going with the rest of the build, even when some classes don't compile fully. It will even produce class files for the broken classes if possible, generating methods which throw an exception as soon as they're called.

I会强烈建议您只需取得所有来源的副本,并尽早修复错误,但Eclipse的部分编译可能会帮助您。

I would strongly recommend that you simply take a copy of all the source and fix the errors at least in your own copy as early as possible, but Eclipse's partial compilation may help you.

这篇关于忽略编译错误 - Java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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