Re: When running Ant on command line, how to not-show its WARNINGmessages and only show ERROR messag

Discussion in 'Java' started by Lew, Dec 10, 2011.

  1. Lew

    Lew Guest

    www wrote:
    > I am running Ant on command line, there are many, many WARNING
    > messages, cluttering my screen:


    That's because there are many, many bad code idioms cluttering up your program.

    > [javac] xx.java:48: warning: [unchecked] unchecked call to
    > <K1,V1>build(com.google.common.cache.CacheLoader<? super K1,V1>) as a
    > member of the raw type com.google.common.cache.CacheBuilder
    > [javac] return builder.build(new
    > CacheLoader<LocationAndDataTypeIdentifier, IdentifierZipFileHandler>()
    > [javac] ^
    > [javac] www.java:48: warning: [unchecked] unchecked conversion


    .... such as improper generic conversions.

    I'm guessing there's a type relationship problem between the 'CacheLoader' reference you showed us and the return type of the method, which you declined to show us.

    > [javac] found : com.google.common.cache.Cache
    > [javac] required:
    > com.google.common.cache.Cache<ohd.hseb.hefs.pe.tools.LocationAndDataTypeIdentifier,ohd.hseb.hefs.pe.acceptance.IdentifierZipFileHandler>
    >
    > ...
    >
    > [javac] 1 error
    > [javac] 52 warnings
    >
    > BUILD FAILED
    > /a/b/c/build.xml:106: Compile failed; see the compiler error output
    > for details.
    >
    > I hope to make these warning message go away. I cannot see the
    > compiler error either. There is no a output file. Should the error be
    > on the screen?


    You show us some of the error messages that you say "clutter up your screen". Doesn't that count as "on the screen"?

    What do you mean "no a output file"?

    Ant reports all javac output in its output. Since you show us some of youroutput, I conclude that the thing you want to see is in your output, just not in the part you deigned to share.

    I've used Ant lots of times to compile, build and run Java programs. The output shows up on the screen just as you showed it, every time, unless redirected. The output is the literal output of the 'javac' compiler, in the case of compilation, and therefore contains all the information you can get to track down your many, many bugs.

    --
    Lew
     
    Lew, Dec 10, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael Justin
    Replies:
    12
    Views:
    1,221
    Arne Vajhøj
    Nov 26, 2009
  2. John B. Matthews
    Replies:
    0
    Views:
    765
    John B. Matthews
    Dec 9, 2011
  3. Roedy Green
    Replies:
    5
    Views:
    2,355
    Gene Wirchenko
    Dec 13, 2011
  4. thunk
    Replies:
    1
    Views:
    330
    thunk
    Mar 30, 2010
  5. thunk
    Replies:
    0
    Views:
    509
    thunk
    Apr 1, 2010
Loading...

Share This Page