简体   繁体   English

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

[英]Java Batch Compiler - ignore all warnings through command line option

I see these runtime programming options: https://help.eclipse.org/2018-12/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-using_batch_compiler.htm 我看到了这些运行时编程选项: https : //help.eclipse.org/2018-12/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-using_batch_compiler.htm

but I am wondering if there is a command line flag I can use to ignore warnings outputted by the compiler (I just want to see errors). 但我想知道是否有命令行标志可用于忽略编译器输出的警告(我只想查看错误)。

For example I see: 例如,我看到:

----------
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(
               ^^^^^^^^

Only looking to see ERRORs, not WARNINGs. 仅查看错误而不是警告。

looks like javac -nowarn does the trick, also should work with other java compilers besides javac. 看起来像javac -nowarn可以解决问题,除了javac之外,还应该与其他Java编译器一起工作。

The option is mentioned here: https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-using_batch_compiler.htm 这里提到了该选项: https : //help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-using_batch_compiler.htm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM