You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I installed libcap in linux and runed pcap4j . but program report path is null point exception
so I fixed it by modifying the org/pcap4j/core/NativeMappings.java file details as follows:
45 line
static final File NPCAP_DIR =
Paths.get(System.getenv("SystemRoot"), "System32", "Npcap").toFile();
Because System.getenv("SystemRoot") is null when programmer runing on linux.
So I change the code as follows:
static File NPCAP_DIR;
I installed libcap in linux and runed pcap4j . but program report path is null point exception
so I fixed it by modifying the org/pcap4j/core/NativeMappings.java file details as follows:
45 line
static final File NPCAP_DIR =
Paths.get(System.getenv("SystemRoot"), "System32", "Npcap").toFile();
Because System.getenv("SystemRoot") is null when programmer runing on linux.
So I change the code as follows:
static File NPCAP_DIR;
static {
LOG.info("NPCAP_DIR: "+ NativeMappings.NPCAP_DIR);
String evn = System.getenv("SystemRoot");
LOG.info("NPCAP_DIR evn: "+ evn);
if(evn!=null) {
Path path = Paths.get(System.getenv("SystemRoot"), "System32", "Npcap");
if(path!=null ) {
LOG.info("NPCAP_DIR: "+ path.getFileName());
NPCAP_DIR = path.toFile();
}else {
LOG.info("NPCAP_DIR IS NULL");
}
}
}
The text was updated successfully, but these errors were encountered: