0

I am trying to make a packet sniffer in java.

My environment is Ubuntu 12.04 64bit.

The first thing I found from internet recommends install Jpcap,

But I could not find any Jpcap installation files for Ubuntu 64bit.

After that I was trying to install libpcap.

I have downloaded source file from http://www.tcpdump.org .

However, when I commands "./configure", it shows me errors like below.

 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.

it sounds like I have to install flex which I really do not want to.

So is there any way to install this or replacement of this which

library for java, so I can use classes in eclipse?

Thanks for reading and answers.

And can I get some java sample codes for capturing packets?

Juneyoung Oh
  • 7,318
  • 16
  • 73
  • 121
  • why not install flex? `build-essential` might include it i think – Karthik T Jul 01 '13 at 06:16
  • 1
    Why don't you just `apt-get install libpcap`? – fge Jul 01 '13 at 06:27
  • @fge I already tried that one. But it displays Unable to locate package libpcap. – Juneyoung Oh Jul 01 '13 at 07:02
  • @KarthikT For test, I can install flex. But for realize, I can not install. this program will run on Server. If I want to install flex additionally it take many times and steps. That is why I do not want to use extra things. – Juneyoung Oh Jul 01 '13 at 07:04
  • libpcap _is_ available for Ubuntu. Its name may not be libpcap. Just `apt-cache search pcap` and pick the right choice. – fge Jul 01 '13 at 07:07
  • @fge Maybe name is OK. when I did that command I can get libpcap0.8. But anyway, it stil needs flex. I guess maybe flex is very necessary factor of libpcap. Maybe I should install flex :-( – Juneyoung Oh Jul 01 '13 at 08:33

0 Answers0