Java 5.0 - Ant/javac

Codes developed before Java 5.0 could be compiled under JDK 1.5. However, it could generate compile warnings. Such as unchecked, deprecated, etc.. Two ways of compile options are suggested:

  • javac

    use -Xlint option

    Example:

    
    > javac -Xlint foo.java
    
  • Ant

    use -Xlint in compiler argument option

    Example:

    
    <javac srcdir=sources
    destdir=classes>
    
    <compilerarg value="-Xlint">
    </javac>