Java Batch编译器-通过命令行选项忽略所有警告

时间:2019-02-13 23:33:46

标签: java javac java-batch java-batch-compiler

我看到以下运行时编程选项: https://help.eclipse.org/2018-12/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-using_batch_compiler.htm

但是我想知道是否有命令行标志可以用来忽略编译器输出的警告(我只是想看看错误)。

例如,我看到:

----------
59. WARNING in /home/oleg/codes/oresoftware/vertx.api/src/main/java/huru/middleware/ErrorHandler.java (at line 16)
        HttpServerRequest request = ctx.request();
                          ^^^^^^^
The value of the local variable request is not used
----------
60. WARNING in /home/oleg/codes/oresoftware/vertx.api/src/main/java/huru/util/Asyncc.java (at line 121)
        public static AsyncTask zoom() {
                      ^^^^^^^^^
Asyncc.AsyncTask is a raw type. References to generic type Asyncc.AsyncTask<T,E> should be parameterized
----------
61. WARNING in /home/oleg/codes/oresoftware/vertx.api/src/main/java/huru/util/Asyncc.java (at line 124)
        v.done(null, null);
        ^^^^^^^^^^^^^^^^^^
Type safety: The method done(Object, Object) belongs to the raw type Asyncc.IAsyncCallback. References to generic type Asyncc.IAsyncCallback<T,E> should be parameterized
----------
62. ERROR in /home/oleg/codes/oresoftware/vertx.api/src/main/java/huru/util/Asyncc.java (at line 131)
        Asyncc.Parallel(asList(
               ^^^^^^^^

仅查看错误而不是警告。

1 个答案:

答案 0 :(得分:0)

看起来javac -nowarn可以解决问题,除了javac之外,它还应该可以与其他Java编译器一起工作。

此处提到了该选项: https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-using_batch_compiler.htm