How to add jcap.jar and its Javadoc into Netbeans

天涯浪子 提交于 2019-12-25 03:59:11

问题


i want to add jpcap.jar the path is this:

C:\WINDOWS\Sun\Java\lib\ext

how to do this?

import java.lang.ClassLoader;

is it needed? or:

  System.loadLibrary('what must be in here?');

or:

System.load(???);

suppose this code:

public void receivePacket(Packet packet) {
System.out.println(packet);
if (packet instanceof IPPacket) {
IPPacket ipp = (IPPacket)packet;
InetAddress dest = ipp.dst_ip;
InetAddress src = ipp.src_ip;
System.out.print(src);
System.out.print(dest);
 }

in the main i have this:

s.receivePacket(Packet.EOF);

but it returns:

0.0

i added library with rightclick add library but i think it doesn't work cause: i have this when selecting packet

Javadoc not found. Either Javadoc documentation for this item does not exist or you have not added specified Javadoc in the Java Platform Manager or the Library Manager


回答1:


Here you will find the answer on how to add jcap.jar: how-to-add-library-files-in-netbeans.

The absence of javadoc doesn't mean that you haven't added the library itself, because javadocs are usually in separate jars or zips.

If the code that uses library method is compiled, than the problem is not in the absence of library.

Usually, the source code of any java library, the binary files and javadoc are contained in separate jar-files, zip-files or folders.

UPDATE: The soulution is:

  1. download jpcap-x.x.zip from here;
  2. unzip it to any folder you like;
  3. add the doc/javadoc subfolder of unzipped folder to your library in library manager.

Video How-To.




回答2:


Nice to see that your problem is solved after a lot of struggle. Have a look at which4j project. It can help solve these issues quickly



来源:https://stackoverflow.com/questions/6256111/how-to-add-jcap-jar-and-its-javadoc-into-netbeans

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!