Make sure that your code introduces no new warnings into the javac compilation.
To compile with Hadoop 1.x
> ant clean jar
To compile with Hadoop 2.x
> ant clean jar -Dhadoopversion=23
The hadoopversion setting has 2 values - 20 and 23. -Dhadoopversion=20 which is the default denotes the Hadoop 0.20.x and 1.x releases which are the old versions with JobTracker. -Dhadoopversion=23 denotes the Hadoop 0.23.x and Hadoop 2.x releases which are the next gen versions of Hadoop which are based on YARN and have separate Resource Manager and Application Masters instead of a single JobTracker that managed both resources (cpu, memory) and running of mapreduce applications. The exact versions of Hadoop 1.x or 2.x pig compiles against is configured in ivy/libraries.properties and is usually updated to compile against the latest stable releases.