0

I seem to have a strange issue which is most likely to be caused by not understanding how the including of additional libraries in java work.

I wrote a program that uses jnetpcap.jar to work with pcap files. The application is running fine when I start it from eclipse and has also worked many times by exporting a runnable jar (copying required-libraries to sub-folder). It even worked on other computers. As mentioned in jnetpcap doc, the computers running windows have put jnetpcap.dll into C:\Windows (according on every machine the x86 or x64 dll)

Anyhow, the following scenario is reproducable on my and other machines:

  • running the complete eclipse project works
  • running from cmd with java -jar pcapdump.jar works
  • double-click jar the gui etc. works - but the "main work" is not done, so no pcap file is used.

I don't see any errors in my logs.

Configuration in eclipse:

  • added an external user library. pointing to my local jnetpcap.jar and source-jar.

When exporting as runnable-jar with copying libs to sub-folders the jnetpcap.jar gets copied into a separate sub-folder. Like I did it many times before.

Anyhow the described problem exists today and I don't know what I am doing wrong or what may be wrong.

Stefan
  • 2,603
  • 2
  • 33
  • 62
  • I think, you want to execute jar file by javaw.exe, `Right Click` the file. Click `Change` button in `Genera` tag. Find out your `javaw.exe`. Click `OK`. Try! – Zaw Than oo Jan 08 '14 at 09:30
  • @CycDemo when using double-click i can see that it gets executed by javaw. this is not the problem as the pure java application seems to work. Executing the necessary parts that have functionality from jnetpcap don't seem to work – Stefan Jan 08 '14 at 09:32

0 Answers0