Why are you trying to sniff packets? Is it a Java exercise or is it just to see what packets are being transmitted?

If your goal is just to sniff packets to see them, Wireshark is a great tool to...