title: How to make Packet sniffer in java?
body: <p>I am trying to make a packet sniffer in java.</p>
  
  <p>My environment is Ubuntu 12.04 64bit.</p>
  
  <p>The first thing I found from internet recommends install Jpcap,</p>
  
  <p>But I could not find any Jpcap installation files for Ubuntu 64bit.</p>
  
  <p>After that I was trying to install libpcap. </p>
  
  <p>I have downloaded source file from <a href="http://www.tcpdump.org" rel="nofollow">http://www.tcpdump.org</a> .</p>
  
  <p>However, when I commands "./configure", it shows me errors like below.</p>
  
  <pre><code> error: Your operating system's lex is insufficient to compile
   libpcap.  flex is a lex replacement that has many advantages, including
   being able to compile libpcap.
  </code></pre>
  
  <p>it sounds like I have to install flex which I really do not want to.</p>
  
  <p>So is there any way to install this or replacement of this which</p>
  
  <p>library for java, so I can use classes in eclipse?</p>
  
  <p>Thanks for reading and answers.</p>
  
  <p>And can I get some java sample codes for capturing packets? </p>